hohav / peppi

Rust parser for Slippi SSBM replay files
MIT License
37 stars 9 forks source link

Add benchmarks #43

Closed NickCondron closed 8 months ago

NickCondron commented 1 year ago

achieves #38

The benchmark I setup runs all replays in benches/data/ for each of three test cases (7 replays * 3 = 21 total benchmarks):

  1. Parse into a Game struct
  2. Parse by passing in a dummy Handlers struct
  3. Parse into a Game struct with skip_frames: true

Note: currently a bug prevents peppi from parsing the entire casual_doubles.slp replay (see #42). However, the benchmark still runs fine.

Currently the benchmarks times are inconsistent (roughly +/- 5% or so) on my laptop. I tried playing with the settings, but couldn't fully shake the inconsistency. Maybe a different computer would do better. The replays are setup where reading from disk and dropping the Game does not affect the results, but other factors like system load can affect things. ~This is why I'm considering using iai also.~

Edit: I added Iai benchmarks and they look great. Run-to-run they change <1% except sometimes for the skip_frames tests (but those are so much faster anyways it's not a big concern). We should keep both though because they each have their pros and cons.

hohav commented 8 months ago

Merged via b62b81156f7db999239c49a2c0c886338d5b3bac and 0c671c82ffcc633b3540dac518ef737ed7e7c6b4. Thank you!