Fast & Elegant demo parser for Counter-Strike 2 in Rust.
The parser is designed for mass-scale demo analyzing, and is heavily optimized to reduce the time required to parse a 30-minute demo on a single thread to merely 500 ms, shifting the bottleneck from CPU to bandwidth.
which is approximately 5x faster than demoinfocs-golang!
The parser will only decode enquired fields from entity, enabling an extremely low memory footprint.
MB
1.480^#
|#
|#
|#
|#
|#::::::@@@::::::@:::::::@:@:::::::::::::@@::::::@:::::@::::@::::@::::@::
|#::::::@@ ::::::@:::::::@:@:::::: ::::::@ :::: :@:::::@::::@::::@::::@::
|#::::::@@ ::::::@:::::::@:@:::::: ::::::@ :::: :@:::::@::::@::::@::::@::
|#::::::@@ ::::::@:::::::@:@:::::: ::::::@ :::: :@:::::@::::@::::@::::@::
|#::::::@@ ::::::@:::::::@:@:::::: ::::::@ :::: :@:::::@::::@::::@::::@::
|#::::::@@ ::::::@:::::::@:@:::::: ::::::@ :::: :@:::::@::::@::::@::::@::
|#::::::@@ ::::::@:::::::@:@:::::: ::::::@ :::: :@:::::@::::@::::@::::@::
|#::::::@@ ::::::@:::::::@:@:::::: ::::::@ :::: :@:::::@::::@::::@::::@::
|#::::::@@ ::::::@:::::::@:@:::::: ::::::@ :::: :@:::::@::::@::::@::::@::
|#::::::@@ ::::::@:::::::@:@:::::: ::::::@ :::: :@:::::@::::@::::@::::@::
|#::::::@@ ::::::@:::::::@:@:::::: ::::::@ :::: :@:::::@::::@::::@::::@::
|#::::::@@ ::::::@:::::::@:@:::::: ::::::@ :::: :@:::::@::::@::::@::::@::
|#::::::@@ ::::::@:::::::@:@:::::: ::::::@ :::: :@:::::@::::@::::@::::@::
|#::::::@@ ::::::@:::::::@:@:::::: ::::::@ :::: :@:::::@::::@::::@::::@::
|#::::::@@ ::::::@:::::::@:@:::::: ::::::@ :::: :@:::::@::::@::::@::::@::
0 +----------------------------------------------------------------------->
Check example.rs for a detailed usage.
Because of the design of how polymorphic fields are implemented in Source2,
you have to register entity classes with polymorphic fields present,
as the entity decoder have to keepthe state of polymorphic field types tracked.
You can search for the keyword polymorphic field
in generated headers to find all fields that are mandatory to register.
To avoid the hassle of manually maintaining the entity struct and game events, we built a header dumper that automatically generates them for you.
cargo run --release --example dump_header --features handle_packet -- /path/to/demo.dem > header.rs
Make sure to only take fields & classes necessary to keep the performance optimal.
Here's the header we generated for you.