summaryrefslogtreecommitdiff
path: root/Readme.md
blob: 60001bc31d4b2e4290498b4a719cacef727e5a23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Arena allocator benchmark

`50_000_000` of 16 byte allocations, `-Ofast`, without sanitizers.

arena-malloc (`realloc` 1.5x of size):

```
$ perf stat -r10 -B ./arena-malloc

 Performance counter stats for './arena-malloc' (10 runs):

            488.01 msec task-clock:u                     #    0.976 CPUs utilized               ( +-  1.63% )
                 0      context-switches:u               #    0.000 /sec
                 0      cpu-migrations:u                 #    0.000 /sec
            44,696      page-faults:u                    #   91.589 K/sec                       ( +-  4.72% )
       278,282,629      cycles:u                         #    0.570 GHz                         ( +-  0.45% )
       700,173,708      instructions:u                   #    2.52  insn per cycle              ( +-  0.00% )
       100,070,698      branches:u                       #  205.060 M/sec                       ( +-  0.00% )
             2,739      branch-misses:u                  #    0.00% of all branches             ( +-  0.89% )

           0.49999 +- 0.00898 seconds time elapsed  ( +-  1.80% )
```

arena-memstream (`open_memstream`, `fwrite`, `fflush`):
```
$ perf stat -r10 -B ./arena-memstream

 Performance counter stats for './arena-memstream' (10 runs):

          3,914.75 msec task-clock:u                     #    0.978 CPUs utilized               ( +-  0.07% )
                 0      context-switches:u               #    0.000 /sec
                 0      cpu-migrations:u                 #    0.000 /sec
            46,927      page-faults:u                    #   11.987 K/sec                       ( +-  0.39% )
     8,395,773,261      cycles:u                         #    2.145 GHz                         ( +-  0.07% )
    14,089,659,266      instructions:u                   #    1.68  insn per cycle              ( +-  0.00% )
     2,871,455,062      branches:u                       #  733.496 M/sec                       ( +-  0.00% )
           447,933      branch-misses:u                  #    0.02% of all branches             ( +- 47.49% )

           4.00461 +- 0.00335 seconds time elapsed  ( +-  0.08% )
```