summaryrefslogtreecommitdiff
path: root/Android.bp
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2019-04-05 09:59:28 -0700
committerChristopher Ferris <cferris@google.com>2019-04-05 14:48:37 -0700
commit0af4ee86dfa643feb786d659dbb219133c776a34 (patch)
treec2fc6155506e509081b8f5d54fd1e89464bf6958 /Android.bp
parent46971b81ee021c2ca19da8d65bdca8a61669ce41 (diff)
Fix performance of multiple same size allocations.
It was found that keeping just a few allocations of the same size around (even up to only 3) increases the allocation time significantly. This appears to be because I set the minimum tcache entries to 1. Removing this and the performance comes mostly all of the way back. There is still some loss, but probably just due to a different bin layout than jemalloc 4.x. This does increase the PSS slightly for many processes. About 1MB in my trace runs. However, it increases the performance of most multiple allocations by a factor of three. Bug: 129743239 Test: Ran memory_replay on all traces. Test: Ran new bionic benchmarks to verify things get better. Change-Id: Iff41d5b5002919c4df03fcb7d742e501f9e38b8e
Diffstat (limited to 'Android.bp')
-rw-r--r--Android.bp4
1 files changed, 1 insertions, 3 deletions
diff --git a/Android.bp b/Android.bp
index e2a29024..4fa62844 100644
--- a/Android.bp
+++ b/Android.bp
@@ -59,9 +59,6 @@ common_c_local_includes = [
// 1 << XX is the maximum sized allocation that will be in the tcache.
android_common_cflags = [
- "-DANDROID_TCACHE_NSLOTS_SMALL_MIN=1",
- "-DANDROID_LG_TCACHE_MAXCLASS_DEFAULT=16",
-
// Default some parameters to small values to minimize PSS.
// These parameters will be overridden by android_product_variables
// for non-svelte configs.
@@ -76,6 +73,7 @@ android_product_variables = {
malloc_not_svelte: {
cflags: [
"-DANDROID_ENABLE_TCACHE",
+ "-DANDROID_LG_TCACHE_MAXCLASS_DEFAULT=16",
"-UANDROID_NUM_ARENAS",
"-DANDROID_NUM_ARENAS=2",