ultimate-research / ssbh_lib

Reading and writing SSBH file formats in Rust
MIT License
8 stars 3 forks source link

investigate performance of ssbh_data -> ssbh_lib conversions #89

Open ScanMountGoat opened 2 years ago

ScanMountGoat commented 2 years ago

The initial performance figures aren't looking too good for Anim. This could benefit from some benchmarking/profiling.

Anim -> AnimData: 726.5µs
AnimData -> Anim -> File: 31.1529ms
ScanMountGoat commented 2 years ago

The bits.extend seems to copy one bit at a time. There should be some way to avoid multiple allocations per compressed buffer and potentially pool some of the bit sets together.

ScanMountGoat commented 2 years ago

Allocating a single buffer and more intelligently setting the elements gives a roughly 4.5x speedup.

Anim -> AnimData: 677.5µs
AnimData -> Anim -> File: 6.845ms