summaryrefslogtreecommitdiff
path: root/libutils/Unicode.cpp
diff options
context:
space:
mode:
authorMark Salyzyn <salyzyn@google.com>2016-09-21 09:24:13 -0700
committerMark Salyzyn <salyzyn@google.com>2016-12-15 22:32:37 +0000
commitdb03b5dd8d7f2c84371bfcf650a1e8ce7bd42b58 (patch)
tree400b42a0bdac70be559848898d2e6b411b6ca653 /libutils/Unicode.cpp
parent0ebf05fabc68067b307bd231de5495a915147d1f (diff)
liblog: event_tag_map use unordered_map
>3 times faster access for lookup functions. Code simplification and C++ coding style conversion. android_lookupEventTagNum has been expanded to utilize the Format match, and then drops down to just Tag match. Performance testing on Hikey, all services stopped, shell only access, CPU not locked had good repeatability. $ adb reboot ; adb wait-for-device ; adb shell su root stop Before this adjustment using binary search: $ /data/nativetest64/liblog-benchmarks/liblog-benchmarks BM_lookupEvent* iterations ns/op Precharge: start Precharge: stop 231 BM_lookupEventTag 10000000 153 BM_lookupEventTag_NOT 20000000 139 BM_lookupEventFormat 10000000 153 After this adjustment strictly using std::unordered_map lookup: $ /data/nativetest64/liblog-benchmarks/liblog-benchmarks BM_lookupEvent* iterations ns/op Precharge: start Precharge: stop 231 BM_lookupEventTag 50000000 56 BM_lookupEventTag_NOT 100000000 21 BM_lookupEventFormat 50000000 56 Test: gTest logd-unit-tests and liblog-unit-tests, liblog-benchmarks. Bug: 31456426 Change-Id: I1cfc3d641c3ea9ab08d455efe0c844d3a6381440
Diffstat (limited to 'libutils/Unicode.cpp')
0 files changed, 0 insertions, 0 deletions