diff options
| author | eunhhu <[email protected]> | 2026-09-30 08:54:29 +0100 |
|---|---|---|
| committer | eunhhu <[email protected]> | 2026-09-30 08:54:29 +0100 |
| commit | 9840d27a9e437de32256024a2fd6a3219a239815 (patch) | |
| tree | eba57012bcdaac8e019d1421370a570a3e9f70d9 /research/experiments/023-node-reuse/summary.py | |
| parent | 987d4d7aa08624e28d0ea18a1e66e359a0230c80 (diff) | |
| download | pure-9840d27a9e437de32256024a2fd6a3219a239815.tar.gz pure-9840d27a9e437de32256024a2fd6a3219a239815.zip | |
Say what snapshots cost the owner, and what reusing their nodes gave (107)
Most of it was the allocator: leaves past glibc's thread cache, freed by
whichever thread let the last snapshot go. jemalloc was 11-14% faster
at more memory; reusing the nodes in Pure gave a median +9.4% over six
pairs, 4-8% less CPU a transaction in all six, and 1.97x the state bytes
resident where it was 2.18x. TPC-C in RAM is now 4.0x a tuned SQLite at
W=1 and 3.5x at W=4; finding items is the owner's largest part now.
Diffstat (limited to 'research/experiments/023-node-reuse/summary.py')
| -rw-r--r-- | research/experiments/023-node-reuse/summary.py | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/research/experiments/023-node-reuse/summary.py b/research/experiments/023-node-reuse/summary.py new file mode 100644 index 0000000..e5fbbb0 --- /dev/null +++ b/research/experiments/023-node-reuse/summary.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python3 +"""docs/research/107's numbers from the result files beside this one: the +allocators, before and after in turns (six pairs: runs.sh made the first +three, before first; three more followed, after first), and 106's RAM +matrix again (with 022-tpcc-grouped/tables.py).""" +import importlib.util +import json +from pathlib import Path + +HERE = Path(__file__).resolve().parent + + +def pure_run(name): + run = end = None + for line in (HERE / f'2026-09-30-{name}-linux-aarch64.jsonl').read_text().splitlines(): + r = json.loads(line) + run = r if r['step'] == 'run' else run + end = r if r['step'] == 'end' else end + return run, end + + +def row(label, name): + run, end = pure_run(name) + ratio = end['pure_resident_mib'] / end['pure_state_mib'] + print(f"| {label} | {run['transactions_per_second']:,} | {run['cpu_us_per_transaction']} | " + f"{run['core_shares']['pure-owner']:.2f} | {end['pure_resident_mib']:.0f} / {end['pure_state_mib']:.0f} MiB " + f"({ratio:.2f}) |") + return run['transactions_per_second'] + + +print('| | 초당 거래 | 거래당 CPU (µs) | 소유자의 코어 몫 | 상주 / 상태 (배수) |') +print('|---|---:|---:|---:|---:|') +for name, label in (('allocator-glibc-1', 'glibc'), ('allocator-jemalloc-1', 'jemalloc'), + ('allocator-tcache-1', 'glibc, tcache_max=4096'), ('allocator-glibc-2', 'glibc'), + ('allocator-jemalloc-2', 'jemalloc')): + row(label, name) +print() +print('| | 초당 거래 | 거래당 CPU (µs) | 소유자의 코어 몫 | 상주 / 상태 (배수) |') +print('|---|---:|---:|---:|---:|') +for round in range(1, 7): # 1-3 before first, 4-6 after first + before = row(f'전, {round}', f'before-{round}') + after = row(f'후, {round}', f'after-{round}') + print(f'| ({(after / before - 1) * 100:+.1f}%) | | | | |') +print() +spec = importlib.util.spec_from_file_location('tables', HERE.parent / '022-tpcc-grouped' / 'tables.py') +tables = importlib.util.module_from_spec(spec) +spec.loader.exec_module(tables) +tables.OUT = HERE +for name in ('ram-w1', 'ram-w4'): + tables.table(name, False) |
