-
Notifications
You must be signed in to change notification settings - Fork 38
Commit bf4a4c3
authored
inline histogram record (gives 10x boost) (#124)
Before inlining:
```
====================
PrometheusBenchmarks
====================
DurationHistogram
╒═══════════════════════════════╤═══════════╤═══════════╤═══════════╤═══════════╤═══════════╤═══════════╤═══════════╤═══════════╕
│ Metric │ p0 │ p25 │ p50 │ p75 │ p90 │ p99 │ p100 │ Samples │
╞═══════════════════════════════╪═══════════╪═══════════╪═══════════╪═══════════╪═══════════╪═══════════╪═══════════╪═══════════╡
│ Instructions * │ 3213 │ 3215 │ 3215 │ 3217 │ 3219 │ 3432 │ 3452 │ 10000 │
├───────────────────────────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┤
│ Malloc (total) * │ 0 │ 0 │ 0 │ 0 │ 0 │ 0 │ 0 │ 10000 │
├───────────────────────────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┤
│ Memory (resident peak) (K) │ 8421 │ 8757 │ 8774 │ 8790 │ 8798 │ 8798 │ 8798 │ 10000 │
├───────────────────────────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┤
│ Throughput (# / s) (K) │ 4556 │ 4135 │ 4009 │ 3877 │ 3765 │ 3569 │ 3272 │ 10000 │
├───────────────────────────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┤
│ Time (total CPU) (ns) * │ 221 │ 244 │ 252 │ 260 │ 268 │ 282 │ 307 │ 10000 │
├───────────────────────────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┤
│ Time (wall clock) (ns) * │ 220 │ 242 │ 249 │ 258 │ 266 │ 280 │ 306 │ 10000 │
╘═══════════════════════════════╧═══════════╧═══════════╧═══════════╧═══════════╧═══════════╧═══════════╧═══════════╧═══════════╛
```
After inlining:
```
====================
PrometheusBenchmarks
====================
DurationHistogram
╒═══════════════════════════════╤═══════════╤═══════════╤═══════════╤═══════════╤═══════════╤═══════════╤═══════════╤═══════════╕
│ Metric │ p0 │ p25 │ p50 │ p75 │ p90 │ p99 │ p100 │ Samples │
╞═══════════════════════════════╪═══════════╪═══════════╪═══════════╪═══════════╪═══════════╪═══════════╪═══════════╪═══════════╡
│ Instructions * │ 281 │ 281 │ 281 │ 281 │ 281 │ 283 │ 299 │ 10000 │
├───────────────────────────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┤
│ Malloc (total) * │ 0 │ 0 │ 0 │ 0 │ 0 │ 0 │ 0 │ 10000 │
├───────────────────────────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┤
│ Memory (resident peak) (K) │ 8405 │ 8724 │ 8741 │ 8757 │ 8765 │ 8765 │ 8765 │ 10000 │
├───────────────────────────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┤
│ Throughput (# / s) (M) │ 53 │ 51 │ 51 │ 48 │ 42 │ 36 │ 26 │ 10000 │
├───────────────────────────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┤
│ Time (total CPU) (ns) * │ 20 │ 21 │ 22 │ 23 │ 26 │ 30 │ 40 │ 10000 │
├───────────────────────────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────┤
│ Time (wall clock) (ns) * │ 19 │ 20 │ 20 │ 21 │ 24 │ 28 │ 39 │ 10000 │
╘═══════════════════════════════╧═══════════╧═══════════╧═══════════╧═══════════╧═══════════╧═══════════╧═══════════╧═══════════╛
```
Used cherry pick benchmarks from this PR:
#1061 parent ba92571 commit bf4a4c3Copy full SHA for bf4a4c3
File tree
Expand file treeCollapse file tree
1 file changed
+1
-0
lines changedFilter options
- Sources/Prometheus
Expand file treeCollapse file tree
1 file changed
+1
-0
lines changedSources/Prometheus/Histogram.swift
Copy file name to clipboardExpand all lines: Sources/Prometheus/Histogram.swift+1Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
56 | 56 |
| |
57 | 57 |
| |
58 | 58 |
| |
| 59 | + | |
59 | 60 |
| |
60 | 61 |
| |
61 | 62 |
| |
|
0 commit comments