platform_bionic/libc/system_properties
Tom Cherry a5744e213f 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
2020-09-02 16:12:21 +00:00
..
include/system_properties Add benchmark for property mapping 2020-09-02 16:12:21 +00:00
Android.bp Add benchmark for property mapping 2020-09-02 16:12:21 +00:00
context_lookup_benchmark.cpp Add benchmark for property mapping 2020-09-02 16:12:21 +00:00
context_lookup_benchmark_data.h Add benchmark for property mapping 2020-09-02 16:12:21 +00:00
context_node.cpp Fix PROP_FILENAME_MAX overflow handling 2018-05-01 18:19:21 -07:00
contexts_serialized.cpp Add PR_SET_VMA and PR_SET_VMA_ANON_NAME to <sys/prctl.h>. 2018-08-22 10:36:23 -07:00
contexts_split.cpp Add benchmark for property mapping 2020-09-02 16:12:21 +00:00
prop_area.cpp Split properties into their own class to make testing better 2017-12-18 15:17:55 -08:00
prop_info.cpp Split properties into their own class to make testing better 2017-12-18 15:17:55 -08:00
prop_trace.cpp Adding system property tracing 2020-08-19 12:47:01 +08:00
system_properties.cpp Adding system property tracing 2020-08-19 12:47:01 +08:00