summaryrefslogtreecommitdiff
path: root/libc/malloc_debug/malloc_debug.cpp
diff options
context:
space:
mode:
authorTom Cherry <tomcherry@google.com>2020-09-01 22:35:56 +0000
committerTom Cherry <tomcherry@google.com>2020-09-02 16:12:21 +0000
commita5744e213f4467091a84c1988215d7e1b59c24cc (patch)
tree36d5023d7e53b9f990e42b29f784216a08bcf54b /libc/malloc_debug/malloc_debug.cpp
parent159bb3f86bf2903c0f14fc867c124f88dad775ca (diff)
Add benchmark for property mapping
This benchmarks mapping property prefixes to property contexts with two algorithms: the 'Legacy' method used before Android P and the 'Trie' used afterwards (the code in this directory). It uses input mappings from both Oreo and the latest in AOSP ('S'). Note that there is nearly a 10x increase in the number of mappings in S as there was in Oreo, which was predicted when the trie was designed. Results on cuttlefish: ----------------------------------------------------------- Benchmark Time CPU Iterations ----------------------------------------------------------- LegacyLookupOreo 683576 ns 673538 ns 1060 LegacyLookupS 5683109 ns 5596982 ns 124 TrieLookupOreo 299851 ns 295696 ns 2378 TrieLookupS 584831 ns 576801 ns 1204 The results show that the legacy look up uses 8.3x more CPU time to handle the number of mappings added through S, whereas the Trie lookup uses less than 2x more CPU time, showing that the trie scales better with added mappings. Test: run this benchmark Change-Id: I35c3aa4429f049e327a891f9cbe1901d8855d7ba
Diffstat (limited to 'libc/malloc_debug/malloc_debug.cpp')
0 files changed, 0 insertions, 0 deletions