-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstats.txt
More file actions
103 lines (93 loc) · 7.39 KB
/
Copy pathstats.txt
File metadata and controls
103 lines (93 loc) · 7.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
================================================================================
ZWave Sort — Benchmark Report
Generated : 2026-04-10 16:46:12
================================================================================
SYSTEM
OS : Windows 11
CPU cores : 16
RAM : 27.9 GB available
Python : 3.12.7
NumPy : 2.2.6
Numba : 0.62.1
================================================================================
CORRECTNESS (n = 10,000)
================================================================================
random PASS
sorted PASS
reversed PASS
few_unique PASS
nearly_sorted PASS
pipe_organ PASS
================================================================================
ZWAVESORT PERFORMANCE (ms, best of 3 runs)
================================================================================
Pattern 500 2,000 10,000 50,000 200,000 1,000,000
────────────────────────────────────────────────────────────────────────────────
random 0.035 0.129 0.897 3.035 14.100 62.934
sorted 0.031 0.104 0.470 2.299 9.736 29.657
reversed 0.020 0.061 0.277 1.375 5.949 29.745
few_unique 0.019 0.057 0.262 1.287 5.641 27.853
nearly_sorted 0.032 0.106 0.487 2.312 13.245 65.101
pipe_organ 0.048 0.174 0.963 3.210 12.919 68.993
================================================================================
THROUGHPUT (million elements / second)
================================================================================
Pattern 500 2,000 10,000 50,000 200,000 1,000,000
────────────────────────────────────────────────────────────────────────────────
random 14.29 15.46 11.15 16.47 14.18 15.89
sorted 16.29 19.18 21.26 21.75 20.54 33.72
reversed 25.25 33.00 36.05 36.38 33.62 33.62
few_unique 26.60 35.09 38.11 38.84 35.45 35.90
nearly_sorted 15.48 18.78 20.52 21.63 15.10 15.36
pipe_organ 10.53 11.50 10.39 15.58 15.48 14.49
================================================================================
ZWAVESORT RAW TIMES (seconds, for external comparison)
================================================================================
Pattern 500 2,000 10,000 50,000 200,000 1,000,000
────────────────────────────────────────────────────────────────────────────────
random 0.000035 0.000129 0.000897 0.003035 0.014100 0.062934
sorted 0.000031 0.000104 0.000470 0.002299 0.009736 0.029657
reversed 0.000020 0.000061 0.000277 0.001375 0.005949 0.029745
few_unique 0.000019 0.000057 0.000262 0.001287 0.005641 0.027853
nearly_sorted 0.000032 0.000106 0.000487 0.002312 0.013245 0.065101
pipe_organ 0.000048 0.000174 0.000963 0.003210 0.012919 0.068993
================================================================================
EXTENDED COMPARISON (random data, n = 200,000, best of 5 runs)
================================================================================
Algorithm Time (ms) vs ZWave Notes
────────────────────────────────────────────────────────────────────────────
ZWave Sort 12.004 100.00% baseline
numpy quicksort 11.979 99.79% 1.00x faster than ZWave
numpy mergesort 15.262 127.14% 1.27x slower
numpy heapsort 18.343 152.80% 1.53x slower
numpy stable 15.214 126.74% 1.27x slower
Numba quicksort 18.154 151.23% 1.51x slower
Numba radix sort 9.208 76.71% 1.30x faster than ZWave
Python sorted() 24.078 200.58% 2.01x slower
================================================================================
ALL-PATTERN COMPARISON (ms, n = 200,000)
================================================================================
Algorithm random sorted reversed few_unique nearly_sorte pipe_organ
────────────────────────────────────────────────────────────────────────────────
ZWave Sort 10.499 6.153 5.909 5.633 9.795 9.851
numpy quicksort 12.054 7.912 7.792 5.775 12.230 12.261
numpy mergesort 19.048 6.405 5.960 9.301 14.231 9.783
numpy heapsort 18.489 11.696 11.988 11.608 12.614 12.542
numpy stable 15.383 5.947 5.973 9.256 9.034 6.054
Numba quicksort 18.377 8.492 8.158 11.042 9.312 4698.312
Numba radix sort 9.236 9.671 9.566 8.258 9.332 9.835
Python sorted() 24.534 1.331 1.156 9.696 6.505 1.512
================================================================================
SUMMARY
================================================================================
Tested patterns : random, sorted, reversed, few_unique, nearly_sorted, pipe_organ
Fastest pattern : few_unique (27.853 ms at n=1,000,000)
Slowest pattern : pipe_organ (68.993 ms at n=1,000,000)
Speedup range : 2.5x (best vs worst at n=1,000,000)
How to use these numbers for external comparison:
- Use the 'RAW TIMES' section (seconds) to compare against any
other algorithm on the same machine with the same input sizes.
- The 'few_unique' and 'sorted'/'reversed' times reflect O(n)
fast-exit paths, not the ZWave core algorithm.
- For a fair apples-to-apples comparison use the 'random' row.
================================================================================