OSDN Git Service

[llvm-exegesis] Analysis: writeMeasurementValue(): don't alloc string for double...
authorRoman Lebedev <lebedev.ri@gmail.com>
Mon, 19 Nov 2018 13:28:17 +0000 (13:28 +0000)
committerRoman Lebedev <lebedev.ri@gmail.com>
Mon, 19 Nov 2018 13:28:17 +0000 (13:28 +0000)
commitcd8cc0c7434011f1ca3cd7c3044876a6b50bf501
tree6b514f50ad83bd34dfffd109dfe8fb2231f285e0
parente43de0ffbec998cdab602bbe6bcce447312368f4
[llvm-exegesis] Analysis: writeMeasurementValue(): don't alloc string for double each time.

Summary:
Test data: 500kLOC of benchmark.yaml, 23Mb. (that is a subset of the actual uops benchmark i was trying to analyze!)
Old time: (D54382)
```
 Performance counter stats for './bin/llvm-exegesis -mode=analysis -analysis-epsilon=100000 -benchmarks-file=/tmp/benchmarks.yaml -analysis-inconsistencies-output-file=/tmp/clusters.html' (16 runs):

       9024.354355      task-clock (msec)         #    1.000 CPUs utilized            ( +-  0.18% )
...
            9.0262 +- 0.0161 seconds time elapsed  ( +-  0.18% )
```
New time:
```
 Performance counter stats for './bin/llvm-exegesis -mode=analysis -analysis-epsilon=100000 -benchmarks-file=/tmp/benchmarks.yaml -analysis-inconsistencies-output-file=/tmp/clusters.html' (16 runs):

       8996.541057      task-clock (msec)         #    0.999 CPUs utilized            ( +-  0.19% )
...
            9.0045 +- 0.0172 seconds time elapsed  ( +-  0.19% )
```
-~0.3%, not that much. But this isn't the important part.

Old:
* calls to allocation functions: 2109712
* temporary allocations: 33112
* bytes allocated in total (ignoring deallocations): 4.43 GB

New:
* calls to allocation functions: 2095345 (-0.68%)
* temporary allocations: 18745 (-43.39% !!!)
* bytes allocated in total (ignoring deallocations): 4.31 GB (-2.71%)

Reviewers: courbet, MaskRay, RKSimon, gchatelet, john.brawn

Reviewed By: courbet

Subscribers: tschuett, llvm-commits

Differential Revision: https://reviews.llvm.org/D54383

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347199 91177308-0d34-0410-b5e6-96231b3b80d8
tools/llvm-exegesis/lib/Analysis.cpp