Skip to content

Instantly share code, notes, and snippets.

@MattPD
MattPD / compilers.optimization.speculation.md
Created May 8, 2025 23:16
Compilers: Optimization: Speculation
@MattPD
MattPD / cpp.type_erasure.draft.md
Created June 17, 2021 17:28
C++ Links: Type Erasure (WIP draft)
@MattPD
MattPD / cpp.std.modules.draft.md
Last active January 6, 2025 04:36
C++ links: Modules (WIP draft)
@MattPD
MattPD / analysis.draft.md
Last active April 12, 2025 10:15
Program Analysis Resources (WIP draft)
@MattPD
MattPD / cpp.std.coroutines.draft.md
Last active April 10, 2025 13:50
C++ links: Coroutines (WIP draft)
@MattPD
MattPD / set_benchmark.cpp
Created October 8, 2016 15:54
Find Example - Benchmark (Nonius) Code
/* Running:
BNSIZE=10000; BNQUERIES=1000
./find --param=size:$BNSIZE --param=queries:$BNQUERIES >
results.size=$BNSIZE.queries=$BNQUERIES.txt
./find --param=size:$BNSIZE --param=queries:$BNQUERIES --reporter=html
--output=results.size=$BNSIZE.queries=$BNQUERIES.html
*/
Related to discussion of
http://larshagencpp.github.io/blog/2016/05/01/a-cache-miss-is-not-a-cache-miss
at https://twitter.com/gregerlars/status/726781584481878017
Three variants:
- Simple: cacheS
- Pointer: cacheP
- LinkedList: cacheL
Context -- looking at average stall durations, we can confirm that cacheL wastes considerably more instruction slots than cacheP, which wastes only somewhat more instruction slots than cacheS: