mirror of
https://codeberg.org/icewind/tf-log-parser.git
synced 2026-11-30 12:50:49 +01:00
updates
This commit is contained in:
parent
2a02abf982
commit
b03d328ab9
19 changed files with 1081 additions and 978 deletions
|
|
@ -1,25 +0,0 @@
|
|||
use iai::black_box;
|
||||
use std::convert::TryFrom;
|
||||
use tf_log_parser::raw_event::RawSubject;
|
||||
use tf_log_parser::{parse, LineSplit, RawEvent, SubjectId};
|
||||
|
||||
static LOG: &str = include_str!("../tests/data/log_2892242.log");
|
||||
|
||||
pub fn parse_benchmark() {
|
||||
black_box(parse(black_box(LOG))).ok();
|
||||
}
|
||||
|
||||
pub fn parse_raw() {
|
||||
black_box(
|
||||
LineSplit::new(black_box(LOG))
|
||||
.filter(|line| !line.is_empty())
|
||||
.flat_map(RawEvent::parse)
|
||||
.count(),
|
||||
);
|
||||
}
|
||||
pub fn subject_id() {
|
||||
let raw = black_box(RawSubject::Player("Kumis<10><[U:1:169048576]><Blue>"));
|
||||
black_box(SubjectId::try_from(&raw).unwrap());
|
||||
}
|
||||
|
||||
iai::main!(parse_benchmark, parse_raw, subject_id);
|
||||
Loading…
Add table
Add a link
Reference in a new issue