Optimize Memory::ReadString
This function is responsible for majority of CPU time in prefetto.
Reduce the number of memory reads (don't read strings byte-by-byte).
Update all calls of ReadString to include the third parameter to have
a max read.
Add an Elf creation benchmark since this function is on the elf
creation path.
Test: libunwindstack_unit_test
Change-Id: Ia36e1f1a5ba76c9e9f13c43fb9e3691dde7897f2
diff --git a/libunwindstack/Android.bp b/libunwindstack/Android.bp
index ab59a4b..21da12d 100644
--- a/libunwindstack/Android.bp
+++ b/libunwindstack/Android.bp
@@ -373,7 +373,9 @@
srcs: [
"benchmarks/unwind_benchmarks.cpp",
+ "benchmarks/ElfBenchmark.cpp",
"benchmarks/SymbolBenchmark.cpp",
+ "benchmarks/Utils.cpp",
],
data: [