Conversation
|
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
CodSpeed Performance ReportMerging #7037 will degrade performances by 2.05%Comparing Summary
Benchmarks breakdown
|
a6a6c1a to
243a81b
Compare
| let variants = self.variants.items(); | ||
|
|
||
| let mut formatted_variants = Vec::with_capacity(variants.len()); | ||
| let mut buffer = VecBuffer::with_capacity(variants.len() * 8, f.state_mut()); |
There was a problem hiding this comment.
It would be nice to remove the need for this buffer too but this complicates things a bit because finding the boundaries of a variant suddenly need to account for nested best fitting elements:
StartBestFittingEntry (Outer)
....
StartBestFittingEntry (Inner)
...
EndBestFittingEntry
...
EndBestFittingEntry
The nesting is probably rare because best fitting is almost always used together with Interned, meaning that the nested best fitting most likely ends up being inside of the interned vec, but it remains possible.
243a81b to
b51d602
Compare
ddc19b0 to
5f148a7
Compare
5f148a7 to
0e5caac
Compare
0e5caac to
092c9a2
Compare
ce2b166 to
e1e047f
Compare
092c9a2 to
770e2b4
Compare
fc0d6aa to
409f8f9
Compare
770e2b4 to
37c62ff
Compare
6a31ef4 to
e09159a
Compare
|
Isn't as promising as I thought, or even regressing and it introduces additional complexity. |

Summary
This PR aims to reduce the allocations necessary for
best_fitting.Today:
Vecthat stores all variantsThis PR removes the allocations per variant and instead writes all variants into a single buffer stored on
BestFitting.The downside of this is that resolving the most-flat or most-expanded variants now requires a search for the
StartBestFittingEntryorEndBestFittingEntry. I don't expect this to be significant because best-fitting entries tend to be small (<16 entries).Performance
This gives us a 2% improvement for most files, except the large/dataset.py. I need to dig deeper to understand why only large data set is regressing. This is especially surprising because I would have expected the performance to improve the most for large files that make heavy use of best fitting.
Test Plan
cargo test