summaryrefslogtreecommitdiff
path: root/libcutils/sockets_unix.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
commit700fb87648047d23c947d9020fd35cd47621dc7c (patch)
tree400b42a0bdac70be559848898d2e6b411b6ca653 /libcutils/sockets_unix.cpp
parent4173d9b57c3877532c99d05478a7e9664a737439 (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 'libcutils/sockets_unix.cpp')
0 files changed, 0 insertions, 0 deletions