TimelyDataflow / abomonation

A mortifying serialization library for Rust
MIT License
317 stars 30 forks source link

[Based on #22] Less inline directives, more bench determinism #24

Open HadrienG2 opened 5 years ago

HadrienG2 commented 5 years ago

Following up on #21, this PR proposes to deal away with most of the manual inline annotations in Abomonation, only keeping those which have a proven positive effect on the library's performance as measured by the built-in benchmark suite (in the sense that there is a before/after statistically significant benchmark timing difference, which can be attributed to a different inlining scheme via perf).

Feel free to propose more benchmarks if you feel that the current benchmark set does not provide good enough coverage of what must be fast yet.

As too often when doing performance fine-tuning in Rust, the nice "multiple codegen units" feature that allows rustc to compile stuff fast got in the way by making compilation results (and in particular inlining decisions outside abomonation, e.g. inside of std::test::Bencher) less deterministic. I think that this feature, while undoubtedly worthwhile overall, is a pain for the purpose of precision benchmarking, so I disabled it for the "bench" build profile.

For convenience reasons, this PR is based on #22 so I would suggest reviewing #22 first, or reviewing this one commit by commit or via github's "diff range" feature in order to only consider the diff w.r.t. #22.

Fixes #21.