Closed caibear closed 11 months ago
There isn't a clear policy surrounding this, but in general I prefer to avoid crate-specific "hints" and other optimizations. This is mostly just to avoid gaming the benchmarks, but I think that it also reflects the default performance that users can expect from a crate. Do you think that bitcode would be improperly represented in the benchmarks without these hints? i.e. Without the hints, do we get an incorrect general view of bitcode's performance?
Thanks for responding!
I prefer to avoid crate-specific "hints" and other optimizations. This is mostly just to avoid gaming the benchmarks, but I think that it also reflects the default performance that users can expect from a crate.
I totally agree the benchmarks should not be gamed in any way and that, to the extent possible, they should represent the performance real users can expect to see!
That said, I think the term "default performance" is entirely subjective because performance depends on:
As for "default," some formats require:
I think some optimization is a fair ask for users who care about performance. In other words, the recommended way to integrate bitcode
is not just to import the crate and derive the traits, but to
Without the hints, do we get an incorrect general view of bitcode's performance?
There are a few areas in which I think that the benchmarks unrealistically hold back non-hinted bitcode
:
u16
when there are only 63 possible response codesu64
helps encodings that do var-int by defaultThe currently-existing bitcode
hints can only recover some of the performance lost due to the above.
TL;DR: To get the most realistic view of bitcode
's performance (in order of importance):
bitcode
Thanks for the detailed response, I really appreciate the thought and care you put into it. I'm going to move your very helpful comment to a separate issue so we can have a dedicated space for discussion. I think the hints you have right now are acceptable, I'll let you know if that changes in the future.
Updates to bitcode 0.4.0 which includes both speed and size optimizations.
Additionally some
bitcode_hint
attributes were moved to their respective fields (which improves performance due to a limitation with bitcode's derive macro).