diff options
author | Christopher Ferris <cferris@google.com> | 2017-08-18 15:10:53 -0700 |
---|---|---|
committer | Christopher Ferris <cferris@google.com> | 2017-08-23 15:43:39 -0700 |
commit | 60521c7d52962827b447467ef550d9db05cc358c (patch) | |
tree | 6c080470815a650e39f167101ed4fc633d62fad3 /libbacktrace/Android.bp | |
parent | e3e4ec7c97e7f4beafd5c6d6186018c93a9b6e5d (diff) | |
download | system_core-60521c7d52962827b447467ef550d9db05cc358c.tar.gz system_core-60521c7d52962827b447467ef550d9db05cc358c.tar.bz2 system_core-60521c7d52962827b447467ef550d9db05cc358c.zip |
Speed up map creation.
- Rewrite the Maps::Parse to use open, and a buffer on the stack.
- Rewrite the line parser away from sscanf. The current way sscanf
is used does not catch many malformed lines. In addition, this
new version improves performance by 50% over sscanf on sailfish.
- Add a lot of unit tests for the parser to make sure there are
no problems. In addition, add a special line that was not rejected
with the previous version of the code.
- Add new accessor to get the map at a particular index.
- Add a backtrace benchmark for map creation for both new and old.
This cl results in ~5% speedup and makes the new unwinder map creation
about the same for 64 bit. It's still a bit slower, but not by much.
On 32 bit, we are still about 5% slower than the old creation method,
though.
Bug: 23762183
Test: libunwindstack unit tests pass. Ran the new benchmarks.
Change-Id: Id4431e539f400984e6fad62153fdf4152d518322
Diffstat (limited to 'libbacktrace/Android.bp')
-rw-r--r-- | libbacktrace/Android.bp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libbacktrace/Android.bp b/libbacktrace/Android.bp index c58d77733..12c72b42d 100644 --- a/libbacktrace/Android.bp +++ b/libbacktrace/Android.bp @@ -240,3 +240,17 @@ cc_test { }, }, } + +cc_benchmark { + name: "backtrace_benchmarks", + defaults: ["libbacktrace_common"], + + srcs: [ + "backtrace_benchmarks.cpp", + ], + + shared_libs: [ + "libbacktrace", + "libbase", + ], +} |