sjvanrossum opened a new pull request, #29689:
URL: https://github.com/apache/beam/pull/29689
Second try at this, I've added all the benchmark code and selected the top
performing encoding loop on a variety of platforms. The test produces a
distribution of integers that favors small and negative integers, of which
small integers more so, since a big use case for this is to encode e.g. length
of an array, string, or bit set.
### x86-64 (Intel Haswell/Broadwell)
```
Benchmark Mode Cnt Score
Error Units
VarIntBenchmark.encodeDoLoopBlackhole thrpt 5 86013017.252 ±
6806970.654 ops/s
VarIntBenchmark.encodeDoLoopByteString thrpt 5 52001480.935 ±
2391503.432 ops/s
VarIntBenchmark.encodeDoLoopTwiddleBlackhole thrpt 5 115606286.337 ±
10307425.016 ops/s
VarIntBenchmark.encodeDoLoopTwiddleByteString thrpt 5 35269768.263 ±
4247624.291 ops/s
VarIntBenchmark.encodeLoopBlackhole thrpt 5 162076033.349 ±
5503576.924 ops/s
VarIntBenchmark.encodeLoopByteString thrpt 5 37287976.783 ±
1632643.112 ops/s
VarIntBenchmark.encodeUnrolledBlackhole thrpt 5 420096282.114 ±
9845273.616 ops/s
VarIntBenchmark.encodeUnrolledByteString thrpt 5 77004894.072 ±
7018716.719 ops/s
```
### x86-64 (AMD Rome)
```
Benchmark Mode Cnt Score
Error Units
VarIntBenchmark.encodeDoLoopBlackhole thrpt 5 123455433.566 ±
2830931.390 ops/s
VarIntBenchmark.encodeDoLoopByteString thrpt 5 64090211.182 ±
1168423.271 ops/s
VarIntBenchmark.encodeDoLoopTwiddleBlackhole thrpt 5 151419063.167 ±
641012.559 ops/s
VarIntBenchmark.encodeDoLoopTwiddleByteString thrpt 5 34102636.150 ±
71335.434 ops/s
VarIntBenchmark.encodeLoopBlackhole thrpt 5 301156820.943 ±
3765743.597 ops/s
VarIntBenchmark.encodeLoopByteString thrpt 5 34012332.191 ±
1156788.454 ops/s
VarIntBenchmark.encodeUnrolledBlackhole thrpt 5 364050863.567 ±
1217370.147 ops/s
VarIntBenchmark.encodeUnrolledByteString thrpt 5 72000262.131 ±
179046.038 ops/s
```
### AArch64 (Ampere Altra)
```
Benchmark Mode Cnt Score
Error Units
VarIntBenchmark.encodeDoLoopBlackhole thrpt 5 109318487.269 ±
2335424.919 ops/s
VarIntBenchmark.encodeDoLoopByteString thrpt 5 31038324.469 ±
148553.803 ops/s
VarIntBenchmark.encodeDoLoopTwiddleBlackhole thrpt 5 124143181.724 ±
1989862.490 ops/s
VarIntBenchmark.encodeDoLoopTwiddleByteString thrpt 5 32170367.541 ±
113003.399 ops/s
VarIntBenchmark.encodeLoopBlackhole thrpt 5 283539663.484 ±
12158743.957 ops/s
VarIntBenchmark.encodeLoopByteString thrpt 5 29370381.086 ±
328859.392 ops/s
VarIntBenchmark.encodeUnrolledBlackhole thrpt 5 337059892.532 ±
2263320.241 ops/s
VarIntBenchmark.encodeUnrolledByteString thrpt 5 61207470.641 ±
1658636.828 ops/s
```
### AArch64 (Apple M1 Pro)
```
Benchmark Mode Cnt Score
Error Units
VarIntBenchmark.encodeDoLoopBlackhole thrpt 15 231219020.921 ±
5378093.054 ops/s
VarIntBenchmark.encodeDoLoopByteString thrpt 15 68921470.198 ±
1893119.668 ops/s
VarIntBenchmark.encodeDoLoopTwiddleBlackhole thrpt 15 251498280.161 ±
5892988.470 ops/s
VarIntBenchmark.encodeDoLoopTwiddleByteString thrpt 15 63965169.310 ±
937899.934 ops/s
VarIntBenchmark.encodeLoopBlackhole thrpt 15 430214308.399 ±
6054417.731 ops/s
VarIntBenchmark.encodeLoopByteString thrpt 15 80784537.818 ±
1289706.531 ops/s
VarIntBenchmark.encodeUnrolledBlackhole thrpt 15 425121843.920 ±
5400615.189 ops/s
VarIntBenchmark.encodeUnrolledByteString thrpt 15 190696849.902 ±
7275496.596 ops/s
```
------------------------
Thank you for your contribution! Follow this checklist to help us
incorporate your contribution quickly and easily:
- [ ] Mention the appropriate issue in your description (for example:
`addresses #123`), if applicable. This will automatically add a link to the
pull request in the issue. If you would like the issue to automatically close
on merging the pull request, comment `fixes #<ISSUE NUMBER>` instead.
- [ ] Update `CHANGES.md` with noteworthy changes.
- [ ] If this contribution is large, please file an Apache [Individual
Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
See the [Contributor Guide](https://beam.apache.org/contribute) for more
tips on [how to make review process
smoother](https://github.com/apache/beam/blob/master/CONTRIBUTING.md#make-the-reviewers-job-easier).
To check the build health, please visit
[https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md](https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md)
GitHub Actions Tests Status (on master branch)
------------------------------------------------------------------------------------------------
[](https://github.com/apache/beam/actions?query=workflow%3A%22Build+python+source+distribution+and+wheels%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Python+Tests%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Java+Tests%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Go+tests%22+branch%3Amaster+event%3Aschedule)
See [CI.md](https://github.com/apache/beam/blob/master/CI.md) for more
information about GitHub Actions CI or the [workflows
README](https://github.com/apache/beam/blob/master/.github/workflows/README.md)
to see a list of phrases to trigger workflows.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]