mirror of
https://codeberg.org/icewind/php-literal-parser.git
synced 2026-06-03 10:34:08 +02:00
fix benches
This commit is contained in:
parent
9310fcde66
commit
651d655202
1 changed files with 6 additions and 6 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
extern crate test;
|
||||
|
||||
use php_literal_parser::parse;
|
||||
use php_literal_parser::{from_str, Value};
|
||||
use test::Bencher;
|
||||
|
||||
#[bench]
|
||||
|
|
@ -10,7 +10,7 @@ fn perf_parse_int_basic(b: &mut Bencher) {
|
|||
let input = "12345676";
|
||||
|
||||
b.iter(|| {
|
||||
assert_eq!(parse(input).unwrap(), 12345676);
|
||||
assert_eq!(from_str::<Value>(input).unwrap(), 12345676);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -19,7 +19,7 @@ fn perf_str_double_basic(b: &mut Bencher) {
|
|||
let input = r#""aut dolores excepturi rerum est velit ad natus eveniet quo tenetur et fugiat sit velit ipsam nesciunt sint et architecto""#;
|
||||
|
||||
b.iter(|| {
|
||||
assert!(parse(input).unwrap().is_string());
|
||||
assert!(from_str::<Value>(input).unwrap().is_string());
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -28,7 +28,7 @@ fn perf_str_double_escape(b: &mut Bencher) {
|
|||
let input = r#""aut dolores excepturi rerum est velit ad natus \"eveniet\" quo tenetur et fugiat sit velit ipsam nesciunt sint et architecto""#;
|
||||
|
||||
b.iter(|| {
|
||||
assert!(parse(input).unwrap().is_string());
|
||||
assert!(from_str::<Value>(input).unwrap().is_string());
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -37,7 +37,7 @@ fn perf_str_single_basic(b: &mut Bencher) {
|
|||
let input = r#"'aut dolores excepturi rerum est velit ad natus eveniet quo tenetur et fugiat sit velit ipsam nesciunt sint et architecto'"#;
|
||||
|
||||
b.iter(|| {
|
||||
assert!(parse(input).unwrap().is_string());
|
||||
assert!(from_str::<Value>(input).unwrap().is_string());
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -46,6 +46,6 @@ fn perf_str_single_escape(b: &mut Bencher) {
|
|||
let input = r#"'aut dolores excepturi rerum est velit ad natus \"eveniet\" quo tenetur et fugiat sit velit ipsam nesciunt sint et architecto'"#;
|
||||
|
||||
b.iter(|| {
|
||||
assert!(parse(input).unwrap().is_string());
|
||||
assert!(from_str::<Value>(input).unwrap().is_string());
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue