// pest. The Elegant Parser // Copyright (c) 2018 DragoČ™ Tiselice // // Licensed under the Apache License, Version 2.0 // or the MIT // license , at your // option. All files in the project carrying such notice may not be copied, // modified, or distributed except according to those terms. #![feature(test)] extern crate pest; extern crate pest_grammars; extern crate test; use std::fs::File; use std::io::Read; use test::Bencher; use pest::Parser; use pest_grammars::json::*; #[bench] fn data(b: &mut Bencher) { let mut file = File::open("benches/data.json").unwrap(); let mut data = String::new(); file.read_to_string(&mut data).unwrap(); b.iter(|| JsonParser::parse(Rule::json, &data).unwrap()); }