Mercurial > hg > CbC > CbC_llvm
comparison libc/utils/benchmarks/README.md @ 173:0572611fdcc8 llvm10 llvm12
reorgnization done
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 11:55:54 +0900 |
parents | 1d019706d866 |
children |
comparison
equal
deleted
inserted
replaced
172:9fbae9c8bf63 | 173:0572611fdcc8 |
---|---|
16 | 16 |
17 ```shell | 17 ```shell |
18 apt-get install python3-pip | 18 apt-get install python3-pip |
19 pip3 install matplotlib scipy numpy | 19 pip3 install matplotlib scipy numpy |
20 ``` | 20 ``` |
21 You may need `python3-gtk` or similar package for displaying benchmark results. | |
21 | 22 |
22 To get good reproducibility it is important to make sure that the system runs in | 23 To get good reproducibility it is important to make sure that the system runs in |
23 `performance` mode. This is achieved by running: | 24 `performance` mode. This is achieved by running: |
24 | 25 |
25 ```shell | 26 ```shell |
35 ```shell | 36 ```shell |
36 cd llvm-project | 37 cd llvm-project |
37 cmake -B/tmp/build -Sllvm -DLLVM_ENABLE_PROJECTS=libc -DCMAKE_BUILD_TYPE=Release | 38 cmake -B/tmp/build -Sllvm -DLLVM_ENABLE_PROJECTS=libc -DCMAKE_BUILD_TYPE=Release |
38 make -C /tmp/build -j display-libc-memcpy-benchmark-small | 39 make -C /tmp/build -j display-libc-memcpy-benchmark-small |
39 ``` | 40 ``` |
41 | |
42 The display target will attempt to open a window on the machine where you're | |
43 running the benchmark. If this may not work for you then you may want `render` | |
44 or `run` instead as detailed below. | |
45 | |
46 ## Benchmarking targets | |
47 | |
48 The benchmarking process occurs in two steps: | |
49 | |
50 1. Benchmark the functions and produce a `json` file | |
51 2. Display (or renders) the `json` file | |
52 | |
53 Targets are of the form `<action>-libc-<function>-benchmark-<configuration>` | |
54 | |
55 - `action` is one of : | |
56 - `run`, runs the benchmark and writes the `json` file | |
57 - `display`, displays the graph on screen | |
58 - `render`, renders the graph on disk as a `png` file | |
59 - `function` is one of : `memcpy`, `memcmp`, `memset` | |
60 - `configuration` is one of : `small`, `big` | |
40 | 61 |
41 ## Benchmarking regimes | 62 ## Benchmarking regimes |
42 | 63 |
43 Using a profiler to observe size distributions for calls into libc functions, it | 64 Using a profiler to observe size distributions for calls into libc functions, it |
44 was found most operations act on a small number of bytes. | 65 was found most operations act on a small number of bytes. |
60 - Caching effects can show up here which prevents comparing different hosts | 81 - Caching effects can show up here which prevents comparing different hosts |
61 | 82 |
62 _<sup>1</sup> - The size refers to the size of the buffers to compare and not | 83 _<sup>1</sup> - The size refers to the size of the buffers to compare and not |
63 the number of bytes until the first difference._ | 84 the number of bytes until the first difference._ |
64 | 85 |
65 ## Benchmarking targets | |
66 | |
67 The benchmarking process occurs in two steps: | |
68 | |
69 1. Benchmark the functions and produce a `json` file | |
70 2. Display (or renders) the `json` file | |
71 | |
72 Targets are of the form `<action>-libc-<function>-benchmark-<configuration>` | |
73 | |
74 - `action` is one of : | |
75 - `run`, runs the benchmark and writes the `json` file | |
76 - `display`, displays the graph on screen | |
77 - `render`, renders the graph on disk as a `png` file | |
78 - `function` is one of : `memcpy`, `memcmp`, `memset` | |
79 - `configuration` is one of : `small`, `big` | |
80 | |
81 ## Superposing curves | 86 ## Superposing curves |
82 | 87 |
83 It is possible to **merge** several `json` files into a single graph. This is | 88 It is possible to **merge** several `json` files into a single graph. This is |
84 useful to **compare** implementations. | 89 useful to **compare** implementations. |
85 | 90 |