[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)
commitb311c1d6b866f70e107c2054ebc0763d84cbb98f
tree986db12b655c5af2f81fba4f2a5c1db3bff3e16b
parentf8b28e9bf4720fc737d4db0985f0d173e3b4f2fa
[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

llvm-svn: 347199
llvm/tools/llvm-exegesis/lib/Analysis.cpp