Skip to content

Commit 880115e

Browse files
committed
[libc] Reorganize and clarify a few points around benchmarking
A few documentation clarifications and moving one part of the docs around to be closer to the first mention of display so that it's easier to spot based on some user feedback. Differential Revision: https://reviews.llvm.org/D79443
1 parent f0c08b7 commit 880115e

File tree

1 file changed

+21
-16
lines changed

1 file changed

+21
-16
lines changed

libc/utils/benchmarks/README.md

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Then make sure to have `matplotlib`, `scipy` and `numpy` setup correctly:
1818
apt-get install python3-pip
1919
pip3 install matplotlib scipy numpy
2020
```
21+
You may need `python3-gtk` or similar package for displaying benchmark results.
2122

2223
To get good reproducibility it is important to make sure that the system runs in
2324
`performance` mode. This is achieved by running:
@@ -38,6 +39,26 @@ cmake -B/tmp/build -Sllvm -DLLVM_ENABLE_PROJECTS=libc -DCMAKE_BUILD_TYPE=Release
3839
make -C /tmp/build -j display-libc-memcpy-benchmark-small
3940
```
4041

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`
61+
4162
## Benchmarking regimes
4263

4364
Using a profiler to observe size distributions for calls into libc functions, it
@@ -62,22 +83,6 @@ Benchmarking configurations come in two flavors:
6283
_<sup>1</sup> - The size refers to the size of the buffers to compare and not
6384
the number of bytes until the first difference._
6485

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-
8186
## Superposing curves
8287

8388
It is possible to **merge** several `json` files into a single graph. This is

0 commit comments

Comments
 (0)