README.md
1# NetD benchmarks
2
3These are benchmarks for libc **connect** and **gethostbyname** functions as hooked by netd.
4
5## Infrastructure
6
7The benchmarks are powered by [google-benchmark](https://github.com/google/benchmark), which records
8four statistics:
9
10<table>
11 <tr>
12 <th>Statistic</th>
13 <th>Meaning</th>
14 </tr>
15 <tr>
16 <th>real_time</th>
17 <td>Mean wall-clock time taken for each iteration of the function under test to complete. This
18 includes any time spent in other processes.
19 <p>
20 Some of the **connect** benchmarks override this by implementing their own timings, but
21 the semantics are roughly the same. See connect_benchmark.cpp for details.</td>
22 </tr>
23 <tr>
24 <th>cpu_time</th>
25 <td>Mean time spent in the current thread during each iteration of the function under test. This
26 does not include any time spent in other processes or blocking on I/O.
27 <p>
28 Since almost all of the functionality we are testing here is in the netd server, not the
29 client, these timings are not relevant and should be ignored for most purposes.</td>
30 </tr>
31 <tr>
32 <th>iterations</th>
33 <td>The number of runs of the test function that were executed, across all threads, in order for
34 the test to reach the minimum amount of time run. Most tests here define 'minimum time run'
35 in terms of real time or 'manual time', rather than CPU time, for the reasons above.
36 <p>
37 This should be roughly inversely proportional to **real_time** for single-threaded
38 benchmarks and also somewhat proportional to the number of threads used.</td>
39 </tr>
40 <tr>
41 <th>label</th>
42 <td>Field that the benchmark can fill with an arbitrary string.
43 <p>
44 For graphing purposes, a few of the benchmarks in this directory store the 90th-percentile
45 latency in this field for comparison against the mean latency
46 (it's only possible to plot one other value apart from mean).
47 <p>
48 If the graphing ecosystem ever becomes advanced enough to plot multiple outputs from one
49 label, it might be more useful to log every decile to get a better picture of how spiky
50 things are.</td>
51</table>
52
53# Methods currently being benchmarked
54
55## connect()
56
57- Documented in [connect\_benchmark.cpp](connect_benchmark.cpp)
58
59## getaddrinfo()
60
61- Documented in [dns\_benchmark.cpp](dns_benchmark.cpp)
62
63
64<style type="text/css">
65 tr:nth-child(2n+1) {
66 background: lightgrey;
67 }
68 td,th {
69 text-align: left;
70 vertical-align: top;
71 }
72</style>
73