LRU cache
Hand-rolled LRU (doubly-linked list + map) servicing 100k mixed get/put operations.
Compile time · median (cold)
Full statistics
| Runner | N | Compile | Runtime | P95 | Stddev | RSS | vs pipit | Status |
|---|---|---|---|---|---|---|---|---|
| Native Gocompiled | 7 | 109 ms | 15.4 ms | 15.9 ms | 304 µs | 1.62 GiB | 57.7× | OK |
| Pipitbytecode VM | 7 | 1.89 ms | 87.4 ms | 106 ms | 6.77 ms | 591 MiB | 1.00× | OK |
| CPython 3.14bytecode VM | 7 | 570 µs | 84.7 ms | 85.5 ms | 399 µs | n/a | 0.30× | OK |
| PyPy 7.3tracing JIT | 7 | 406 µs | 17.2 ms | 18.8 ms | 905 µs | n/a | 0.21× | OK |
| tengobytecode VM | 7 | 342 µs | 171 ms | 188 ms | 12.6 ms | 1.68 GiB | 0.18× | OK |
| scriggobytecode VM | 0 | n/a | n/a | n/a | n/a | n/a | n/a | unsupported |
| mvmbytecode VM | 7 | 483 µs | 281 ms | 286 ms | 3.09 ms | 1.68 GiB | 0.26× | OK |
| yaegiAST walker | 7 | 467 µs | 754 ms | 778 ms | 16.7 ms | 1.68 GiB | 0.25× | OK |
Workload & symmetry rules
Workload
A cache of size 4096 sees a 100,000-op trace of 70% reads / 30% writes. Implement using a hash map plus a doubly-linked list for recency. Print the final hit/miss totals.
Symmetry rules
- Hand-rolled linked list; no
OrderedDict, nofunctools.lru_cache. - Generic map / dict for indexing.
Source code
pipit / Go
pipit_source.gonative Go
native_main.goCPython / PyPy
cpython.pytengo
script.tengo