summaryrefslogtreecommitdiffstats
path: root/vendor/dissimilar/benches/bench.rs
blob: 72f2633cc5725b99131b6986e7d219de0b2339d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#![feature(test)]

extern crate test;

use dissimilar::diff;
use std::{fs, io};
use test::Bencher;

#[bench]
fn bench(b: &mut Bencher) -> io::Result<()> {
    let document1 = fs::read_to_string("benches/document1.txt")?;
    let document2 = fs::read_to_string("benches/document2.txt")?;
    b.iter(|| diff(&document1, &document2));
    Ok(())
}