remove allocation for int parsing

This commit is contained in:
Robin Appelman 2020-12-08 20:13:50 +01:00
commit f7ae4135d6
6 changed files with 85 additions and 18 deletions

15
benches/parse.rs Normal file
View file

@ -0,0 +1,15 @@
#![feature(test)]
extern crate test;
use php_literal_parser::parse;
use test::Bencher;
#[bench]
fn perf_parse_int_basic(b: &mut Bencher) {
let input = "12345676";
b.iter(|| {
assert_eq!(parse(input).unwrap(), 12345676);
});
}