mirror of
https://codeberg.org/demostf/parser.git
synced 2026-06-03 18:24:05 +02:00
remove old loop bin what was used for performance measurements
This commit is contained in:
parent
34533a9608
commit
a794df5a5f
2 changed files with 0 additions and 50 deletions
|
|
@ -15,10 +15,6 @@ path = "src/lib.rs"
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "parse_demo"
|
name = "parse_demo"
|
||||||
path = "src/bin/main.rs"
|
path = "src/bin/main.rs"
|
||||||
[[bin]]
|
|
||||||
|
|
||||||
name = "loop"
|
|
||||||
path = "src/bin/loop.rs"
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bitbuffer = "0.9"
|
bitbuffer = "0.9"
|
||||||
|
|
|
||||||
|
|
@ -1,46 +0,0 @@
|
||||||
use std::env;
|
|
||||||
use std::fs;
|
|
||||||
|
|
||||||
use main_error::MainError;
|
|
||||||
use std::thread::sleep;
|
|
||||||
use std::time::Duration;
|
|
||||||
pub use tf_demo_parser::{Demo, DemoParser, Parse, ParseError, ParserState, Stream};
|
|
||||||
|
|
||||||
#[cfg(feature = "jemallocator")]
|
|
||||||
#[global_allocator]
|
|
||||||
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
|
|
||||||
|
|
||||||
fn main() -> Result<(), MainError> {
|
|
||||||
#[cfg(feature = "better_panic")]
|
|
||||||
better_panic::install();
|
|
||||||
|
|
||||||
let args: Vec<_> = env::args().collect();
|
|
||||||
if args.len() < 2 {
|
|
||||||
println!("1 argument required");
|
|
||||||
return Ok(());
|
|
||||||
}
|
|
||||||
let path = args[1].clone();
|
|
||||||
let all = args
|
|
||||||
.get(2)
|
|
||||||
.map(|arg| arg.as_str() == "all")
|
|
||||||
.unwrap_or_default();
|
|
||||||
let file = fs::read(path)?;
|
|
||||||
sleep(Duration::from_secs(1));
|
|
||||||
for _ in 0..10 {
|
|
||||||
parse(&file, all)?;
|
|
||||||
}
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline(never)]
|
|
||||||
fn parse(data: &[u8], all: bool) -> Result<(), MainError> {
|
|
||||||
let demo = Demo::new(data);
|
|
||||||
let parser = if all {
|
|
||||||
DemoParser::new_all(demo.get_stream())
|
|
||||||
} else {
|
|
||||||
DemoParser::new(demo.get_stream())
|
|
||||||
};
|
|
||||||
let (_, state) = parser.parse()?;
|
|
||||||
assert!(state.rounds.len() > 1);
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue