Skip to content
Switch branches/tags
Go to file
Cannot retrieve contributors at this time
// pest. The Elegant Parser
// Copyright (c) 2018 Dragoș Tiselice
// Licensed under the Apache License, Version 2.0
// <LICENSE-APACHE or> or the MIT
// license <LICENSE-MIT or>, at your
// option. All files in the project carrying such notice may not be copied,
// modified, or distributed except according to those terms.
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::*;
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());