... | ... | @@ -8,7 +8,24 @@ inputs together with combinations of different algorithmic choices specified |
|
|
on the command line. The linux ```perf``` program is used to execute
|
|
|
the program and collect performance measures including instruction counts, cycle counts and branch misses. Each combination of performance parameter is run once in order to populate the object cache (and so eliminate the JIT compile time from further runs) as well as to check that each variation produces the same result. Then the program is run several times to obtain averaged measurements of the counters.
|
|
|
|
|
|
Here is a sample script using ```perf_stat_runner```.
|
|
|
```
|
|
|
# NFD_perf.py
|
|
|
|
|
|
from perf_stat_runner import *
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
tester = PerformanceTester("../build16/bin/nfd")
|
|
|
tester.addPositionalParameter("input", ["/home/cameron/Wikibooks/wiki-bo
|
|
|
oks-all.xml"])
|
|
|
|
|
|
tester.addPerformanceKey("--ByteMerging", ["0", "1"])
|
|
|
tester.addPerformanceKey("--ByteReplace", ["0", "1"])
|
|
|
tester.addPerformanceKey("--LateU21", ["0", "1"])
|
|
|
tester.addPerformanceKey("--thread-num", ["1"])
|
|
|
tester.run_tests("nfd-stats.csv")
|
|
|
```
|
|
|
|
|
|
It produces performance results in the ```nfd-stats.csv`` file, with
|
|
|
one row for each of difference performance keys and columns for instructions, cycle counts and branch data.
|
|
|
|
|
|
\ No newline at end of file |