OSDN Git Service

Simpleperf: use OneTimeFreeAllocator to allocate symbol names.
authorYabin Cui <yabinc@google.com>
Fri, 21 Aug 2015 21:23:43 +0000 (14:23 -0700)
committerYabin Cui <yabinc@google.com>
Fri, 21 Aug 2015 23:15:58 +0000 (16:15 -0700)
commitcc2e59e2478d330c89eaceda0dcc1f05ee32fbf8
tree2c84c4b8fa8f8ffd1f6d60f520a28213ef9ad585
parentbb86cc8c6ac869044c3811c59616e01255c983d3
Simpleperf: use OneTimeFreeAllocator to allocate symbol names.

simpleperf report takes a lot of time mallocing and freeing memory.
This change reduces the time to free memory.

Before this change:
$sudo simpleperf stat simpleperf report
Performance counter statistics:

    3,258,481,203  cpu-cycles                # 2.290946 GHz                      (80%)
    4,147,660,154  instructions              # 0.785619 cycles per instruction   (79%)

Total test time: 1.422330 seconds.

After this change:
$sudo simpleperf stat simpleperf report
Performance counter statistics:

   1,699,221,386  cpu-cycles                # 2.994754 GHz                      (79%)
   2,739,945,156  instructions              # 0.620166 cycles per instruction   (81%)

Total test time: 0.567399 seconds.

This change also fix a bug in record_file_test.cpp.

Bug: 23387541

Change-Id: I59fc86ca54a6c09bd08eec8ada931ccff88d3102
simpleperf/callchain.cpp
simpleperf/cmd_report.cpp
simpleperf/dso.cpp
simpleperf/dso.h
simpleperf/record_file_test.cpp
simpleperf/utils.cpp
simpleperf/utils.h