diff options
| author | Elliott Hughes <enh@google.com> | 2021-11-18 17:57:38 -0800 |
|---|---|---|
| committer | Elliott Hughes <enh@google.com> | 2021-12-06 14:55:00 -0800 |
| commit | e4d5efe231bd942fe661a066d9d5c895e950f248 (patch) | |
| tree | 7b1787b1a32199354d1aaa61de8c2e0a0fd9204d /libc/malloc_hooks/tests/malloc_hooks_tests.cpp | |
| parent | a9ebf6f422c1924b3c6486385babc38152c39500 (diff) | |
strftime: format small positive integers ourselves.
A decent chunk of the logcat profile is spent formatting the timestamps
for each line, and most of that time was going to snprintf(3). We should
find all the places that could benefit from a lighter-weight "format an
integer" and share something between them, but this is easy for now.
Before:
-----------------------------------------------------------
Benchmark Time CPU Iterations
-----------------------------------------------------------
BM_time_strftime 781 ns 775 ns 893102
After:
-----------------------------------------------------------
Benchmark Time CPU Iterations
-----------------------------------------------------------
BM_time_strftime 149 ns 147 ns 4750782
Much of the remaining time is in tzset() which seems unfortunate.
Test: treehugger
Change-Id: Ie0f7ee462ff1b1abea6f87d4a9a996d768e51056
Diffstat (limited to 'libc/malloc_hooks/tests/malloc_hooks_tests.cpp')
0 files changed, 0 insertions, 0 deletions
