Disable allocation zeroing in benchmarks on Android#2214
Conversation
This is particularly problematic because large allocations partially used can get eagerly memset even if they hit the backing allocator, faulting in a ton of pages, so the behavior can diverge substantially from real in-app performance.
|
I'm a bit confused by the diff. |
|
my understanding is that this is intended to mimic production allocation behaviour for various android versions. |
|
(I don't have a leg in this either way, i just feel like the actual ansver is something that should be documented at least here as an issue comment.) |
This hardening feature is on by default, but disabled for application processes, so in practice only system services built into the OS have it on. However, the disabling happens at runtime during the initialization of application processes before they load code, and a benchmark binary doesn't have that, so it runs in the "default" misleading configuration. https://android.googlesource.com/platform/bionic/+/HEAD/docs/defines.md The idea is that benchmark binaries built with the toolchain used to build apps should perform the way the code would if it was compiled into an app. |
This is particularly problematic because large allocations partially used can get eagerly memset even if they hit the backing allocator, faulting in a ton of pages, so the behavior can diverge substantially from real in-app performance.