Closed wcampbell0x2a closed 1 year ago
Hey @wcampbell0x2a I have a dumb question - Since in many cases, parsing is for static content (either sizes known fully at compile time or reasonable upper bounds may be known for dynamic content), would it help if memory for these were pre-allocated before getting into read?
Hey @wcampbell0x2a I have a dumb question - Since in many cases, parsing is for static content (either sizes known fully at compile time or reasonable upper bounds may be known for dynamic content), would it help if memory for these were pre-allocated before getting into read?
You can see some tests for allocation counts here: https://github.com/sharksforarms/deku/blob/master/tests/test_alloc.rs. Many of these allocations are quite dynamic based upon bit alignment when reading.
Benchmark for 1b73cc4
Click to view benchmark
This commit showed a %5 performance increase for deku deku_read_byte
on my machine.
Yeah not sure how much I trust the CI benchmarking, I'm not sure it's fully accurate. I'll take a look at this when I have more time, thanks for working on this!
This breaks the logging feature. I'll need to fix that.
I also need to test the old + new with both having LTO enabled. The performance might be worse with this patch.
not true
Still want to do benchmarks and more testing, but it's done-ish
See #344