[SRU] Enable some arm64 performance optimizations already available for other architectures
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
ruby2.5 (Ubuntu) | ||||||
Bionic |
Fix Released
|
Undecided
|
Lucas Kanashiro | |||
ruby2.7 (Ubuntu) |
Fix Released
|
Undecided
|
Lucas Kanashiro | |||
Focal |
Fix Released
|
Undecided
|
Lucas Kanashiro | |||
Groovy |
Fix Released
|
Undecided
|
Lucas Kanashiro |
Bug Description
[Impact]
Upstream merged some changes to improve performance on arm64 which could benefit Ubuntu users:
https:/
FWIW the landing of this patch was driven by AWS to improve performance on their arm64 instances. Actually, those are performance optimizations improvements which arm64 is missing that other architectures have.
Those changes considerably increase the number of instructions executed per second (ips) and also reduce the time to execute different tasks. On the other hand, it increases a bit the memory consumption. Here you can find the results of an experiment where some benchmarks defined by upstream were executed with the proposed patch on top of the Focal source package, a simple rebuild of the Focal version, and the binary from the archive in a Raspberry Pi 4 and a Canonistack VM (check the summary tab):
https:/
It is quite impressive how under some circumstances the ips was increased in more than 50% and the time taken to execute some tasks reduced more than 25%. IMHO those numbers are really good, and the small increase of at most 4% in the memory consumption worth in this case.
[Test Case]
Run the upstream benchmarks in a Ubuntu Focal arm64 machine:
1 - Install the ruby2.7 binary form the archive.
2 - Rebuild the ruby2.7 source package from Focal and install it.
3 - Build the ruby2.7 source package from Focal with the optimization patch on top of it and install it.
4 - Install the benchmark_driver gem. It is not in the archive, so install it from rubygems (sudo gem install benchmark_driver).
5 - Download the benchmarks definition from upstream master branch (https:/
* vm_array.yml
* vm_attr_
* vm_bigarray.yml
* vm_block.yml
* vm_attr_ivar.yml
* vm_backtrace.rb
* vm_bighash.yml
* vm_block_
6 - Run the benchmarks (in the presented experiment 6 rounds were executed):
$ benchmark-driver $BENCHMARK_
-r $runner -e $RUBY_SYSTEM -e $RUBY_PATCHED -e $RUBY_REBUILT
where $BENCHMARK_
[Regression Potential]
The code changes impact only aarch64 so no regression is expected in other architectures. No breakage during runtime is expected.
Based on the experiment presented above we might expect some extra memory consumption hitting users. However, the increase of at most 4% of memory consumption faced during the experiment seems a fair price to pay for the boost in performance this patch will provide.
With performance improvements, particularly in C code, common things to watch for would be segfaults, unexpected behavioral changes, and performance regressions that are seen only on arm64. Mitigating the risk here is that the code paths are already in use for many other architectures.
Related branches
- Bryce Harrington (community): Approve
- Canonical Server: Pending requested
- git-ubuntu developers: Pending requested
-
Diff: 397 lines (+331/-1)8 files modifieddebian/changelog (+19/-0)
debian/control (+1/-0)
debian/patches/0029-Backport-upstream-patch-to-fix-Kiritimati-TZ-test-1-.patch (+58/-0)
debian/patches/0030-Backport-upstream-patch-to-fix-Kiritimati-TZ-test-2-.patch (+46/-0)
debian/patches/arm64-optimizations.patch (+179/-0)
debian/patches/series (+3/-0)
debian/tests/bundled-gems (+24/-1)
debian/tests/control (+1/-0)
- Christian Ehrhardt (community): Approve
- Canonical Server: Pending requested
- git-ubuntu developers: Pending requested
-
Diff: 209 lines (+187/-0)3 files modifieddebian/changelog (+8/-0)
debian/patches/0012-arm64-optimizations.patch (+178/-0)
debian/patches/series (+1/-0)
- Christian Ehrhardt (community): Approve
- Canonical Server Core Reviewers: Pending requested
- Canonical Server: Pending requested
-
Diff: 185 lines (+163/-0)3 files modifieddebian/changelog (+8/-0)
debian/patches/arm64-optimizations.patch (+153/-0)
debian/patches/series (+2/-0)
Changed in ruby2.7 (Ubuntu Bionic): | |
status: | New → Invalid |
Changed in ruby2.5 (Ubuntu Groovy): | |
status: | New → Invalid |
Changed in ruby2.5 (Ubuntu Focal): | |
status: | New → Invalid |
Changed in ruby2.5 (Ubuntu Bionic): | |
status: | New → Triaged |
Changed in ruby2.7 (Ubuntu Focal): | |
status: | New → Triaged |
Changed in ruby2.7 (Ubuntu Groovy): | |
status: | New → Triaged |
Changed in ruby2.5 (Ubuntu): | |
status: | New → Invalid |
Changed in ruby2.7 (Ubuntu): | |
assignee: | nobody → Lucas Kanashiro (lucaskanashiro) |
Changed in ruby2.7 (Ubuntu Focal): | |
assignee: | nobody → Lucas Kanashiro (lucaskanashiro) |
Changed in ruby2.7 (Ubuntu Groovy): | |
assignee: | nobody → Lucas Kanashiro (lucaskanashiro) |
Changed in ruby2.5 (Ubuntu Bionic): | |
assignee: | nobody → Lucas Kanashiro (lucaskanashiro) |
description: | updated |
summary: |
- [SRU] Enable some arm64 optimizations + [SRU] Enable some arm64 performance optimizations already available for + other architectures |
description: | updated |
no longer affects: | ruby2.7 (Ubuntu Bionic) |
no longer affects: | ruby2.5 (Ubuntu Groovy) |
no longer affects: | ruby2.5 (Ubuntu Focal) |
no longer affects: | ruby2.5 (Ubuntu) |
I don't see these changes in groovy at all, is there a reason why?