Skip to content

Instantly share code, notes, and snippets.

@sglienke
sglienke / Swap32
Last active October 20, 2021 11:10
mov eax,ecx
shr eax,$10
and ecx,$0000ffff
mov edx,eax
and edx,$ffff0000
mov r8d,eax
and r8d,$000000ff
shl r8d,$08
and eax,$0000ff00
shr eax,$08
@sglienke
sglienke / PDQSortBench.txt
Created July 24, 2024 16:16
QuickSort, IntroSort, PDQSort Benchmark
-------------------------------------------------------------------------------------
Benchmark Time CPU Iterations
-------------------------------------------------------------------------------------
random/QuickSort/count:100 4040 ns 3640 ns 10
random/IntroSort/count:100 2440 ns 2344 ns 10
random/PDQSort/count:100 2580 ns 2509 ns 10
random/QuickSort/count:1000 67280 ns 67125 ns 10
random/IntroSort/count:1000 47800 ns 47589 ns 10
random/PDQSort/count:1000 47150 ns 47067 ns 10
random/QuickSort/count:10000 631340 ns 630232 ns 10