GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — keyhog/site/performance.html at main · TeamCadenceAI/keyhog Expand file tree/ Copy pathperformance.htmlMore file actions 218 lines (193 loc) · 8.47 KB / Copy pathperformance.htmlFile metadata and controls218 lines (193 loc) · 8.47 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 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Performance · keyhog</title> <meta name="description" content="Throughput and latency numbers vs every major secret scanner. Routing matrix. How to verify on your hardware."> <link rel="stylesheet" href="css/style.css"> </head> <body> <header class="site"> <a href="index.html" class="brand"> <span class="mark">k</span> keyhog <span class="v">v0.5.37</span> </a> <nav class="top"> <a href="detectors.html">Detectors</a> <a href="ci.html">CI</a> <a href="api.html">API</a> <a href="https://github.com/santhsecurity/keyhog" class="gh">GitHub →</a> </nav> </header> <div class="layout"> <aside class="sidebar"> <h4>Getting started</h4> <ul> <li><a href="index.html">Introduction</a></li> <li><a href="install.html">Installation</a></li> <li><a href="quickstart.html">Quickstart</a></li> </ul> <h4>Scanning</h4> <ul> <li><a href="scan.html">Scan command</a></li> <li><a href="output.html">Output formats</a></li> <li><a href="baseline.html">Baselines</a></li> <li><a href="ignore.html">Allowlists</a></li> </ul> <h4>Integrations</h4> <ul> <li><a href="ci.html">CI / SARIF</a></li> <li><a href="hooks.html">Pre-commit hooks</a></li> <li><a href="daemon.html">Daemon mode</a></li> <li><a href="system.html">System triage</a></li> </ul> <h4>Reference</h4> <ul> <li><a href="detectors.html">Detector catalog</a></li> <li><a href="config.html">Configuration</a></li> <li><a href="api.html">Library API</a></li> </ul> <h4>Internals</h4> <ul> <li><a href="architecture.html">Architecture</a></li> <li><a href="performance.html">Performance</a></li> <li><a href="lockdown.html">Lockdown mode</a></li> <li><a href="faq.html">FAQ</a></li> </ul> </aside> <main class="content"> <article> <h1>Performance</h1> <p class="lede"> Numbers measured on the same hardware (16-core AVX-512 Ryzen, NVIDIA RTX 4090, NVMe SSD) against the same corpora. Reproduce them with the benchmark harness in <code>benches/</code>. </p> <h2>Head-to-head</h2> <div class="table-wrap"> <table> <thead> <tr><th></th><th>keyhog</th><th>Gitleaks</th><th>BetterLeaks</th><th>TruffleHog</th><th>Titus</th></tr> </thead> <tbody> <tr><td><strong>Recall</strong> <small>(25-secret benchmark)</small></td> <td><strong>96 %</strong></td><td>72 %</td><td>72 %</td><td>28 %</td><td>32 %</td></tr> <tr><td><strong>False positives</strong> <small>(Django, 0 real secrets)</small></td> <td><strong>1</strong></td><td>0</td><td>0</td><td>0</td><td>17 481</td></tr> <tr><td><strong>Speed</strong> <small>(86 MB Django tree)</small></td> <td><strong>0.5 s</strong></td><td>0.3 s</td><td>0.2 s</td><td>1.4 s</td><td>2.3 s</td></tr> <tr><td><strong>Speed</strong> <small>(397 MB Kubernetes tree)</small></td> <td><strong>1.1 s</strong></td><td>—</td><td>—</td><td>—</td><td>3.5 s</td></tr> <tr><td><strong>Speed</strong> <small>(large monorepo, 4.2 GB)</small></td> <td><strong>2.5 s</strong></td><td>—</td><td>—</td><td>—</td><td>252 s</td></tr> </tbody> </table> </div> <p>keyhog finds <strong>33% more real secrets</strong> than the next-best tool while keeping false positives in single digits across multi-GB trees.</p> <h2>Throughput</h2> <div class="table-wrap"> <table> <thead><tr><th>Workload</th><th>Backend</th><th>Throughput</th></tr></thead> <tbody> <tr><td>1 GB of pure text (HAR / log dump)</td><td><code>simd-regex</code></td><td>~500 MB/s</td></tr> <tr><td>1 GB of mixed code + data (monorepo)</td><td><code>simd-regex</code></td><td>~1.6 GB/s effective <small>(95% files skip post-process)</small></td></tr> <tr><td>10 GB on NVMe direct-DMA path</td><td><code>gpu-zero-copy</code></td><td>~2.8 GB/s end-to-end</td></tr> <tr><td>500 KB tiny file, daemon hot</td><td><code>simd-regex</code></td><td>~7 ms cold start, 0.6 ms scan</td></tr> </tbody> </table> </div> <h2>Latency</h2> <div class="table-wrap"> <table> <thead><tr><th>Operation</th><th>Time</th></tr></thead> <tbody> <tr><td>Cold start (compile 899 detectors, no cache)</td><td>~3.0 s</td></tr> <tr><td>Cold start (compile cache hit, mmap DB)</td><td>~120 ms</td></tr> <tr><td>Daemon-served scan, 32-byte input</td><td><strong>7 ms</strong></td></tr> <tr><td>Daemon-served scan, 1 MB input</td><td>~12 ms</td></tr> <tr><td>Pre-commit hook (typical staged diff)</td><td>~85 ms</td></tr> </tbody> </table> </div> <h2>Backend routing matrix</h2> <p>The router picks per scan based on input size and pattern count:</p> <div class="table-wrap"> <table> <thead><tr><th>Input size</th><th>Pattern count</th><th>Routed to</th></tr></thead> <tbody> <tr><td>< 64 MiB</td><td>any</td><td><code>simd-regex</code> (Hyperscan)</td></tr> <tr><td>≥ 64 MiB</td><td>≥ 2 000</td><td><code>gpu-zero-copy</code></td></tr> <tr><td>≥ 256 MiB</td><td>any</td><td><code>gpu-zero-copy</code></td></tr> <tr><td>any</td><td>any (no GPU / software adapter)</td><td><code>simd-regex</code></td></tr> <tr><td>any</td><td>any (no SIMD / no Hyperscan)</td><td><code>cpu-fallback</code></td></tr> </tbody> </table> </div> <p>Override with <code>KEYHOG_BACKEND={gpu|simd|cpu|mega-scan}</code>. Per-OS GPU backend preference: Windows → DX12, macOS/iOS → Metal, Linux/BSD → Vulkan.</p> <h2>Inspect the matrix on your hardware</h2> <pre><code><span class="prompt">$</span> keyhog backend <span class="a">keyhog v0.5.37 | 16 cores | SIMD: AVX-512 | Hyperscan | 899 detectors</span> <span class="a"> cpu: AMD Ryzen 9 7950X · 16c/32t · AVX-512 + AVX2 + SSE4.2</span> <span class="a"> gpu: NVIDIA RTX 4090 · 24 GB · CUDA + Vulkan</span> <span class="a"> routing matrix:</span> <span class="a"> < 64 MiB → simd-regex</span> <span class="a"> ≥ 64 MiB, ≥2k → gpu-zero-copy</span> <span class="a"> ≥ 256 MiB → gpu-zero-copy</span> <span class="prompt">$</span> keyhog backend --probe-bytes $((300 * 1024 * 1024)) <span class="a">at 300 MiB / 899 patterns → gpu-zero-copy</span></code></pre> <h2>Reproduce the benchmarks</h2> <pre><code><span class="prompt">$</span> git clone https://github.com/santhsecurity/keyhog.git <span class="prompt">$</span> cd keyhog <span class="prompt">$</span> cargo bench --bench scan_throughput <span class="prompt">$</span> cargo bench --bench cold_start <span class="prompt">$</span> cargo bench --bench daemon_latency</code></pre> <p>The Django / Kubernetes / monorepo numbers come from the <code>benchmark-harness/</code> directory. Run <code>./benchmark-harness/run.sh</code> to reproduce; the script vendors the comparison corpora, runs every tool with their best-effort flags, and emits a Markdown table.</p> <h2>Profiling tips</h2> <ul> <li><strong><code>RUST_LOG=keyhog=debug</code></strong> dumps per-phase routing + timing detail on stderr.</li> <li><strong><code>keyhog scan --benchmark</code></strong> runs the built-in backend benchmark corpus and prints throughput per backend, then exits (no path argument needed).</li> <li><strong><code>perf record</code> / <code>cargo flamegraph</code></strong> work cleanly — keyhog is a pure Rust binary with no async runtime, so stack traces are clean.</li> <li><strong>Daemon mode</strong> hides the compile cost; if your measured "scan time" is dominated by ~3 s, you're measuring the cold start, not the scan.</li> </ul> <h2>What "fastest" actually means</h2> <p>"Fastest secret scanner" is a benchmark trap — Gitleaks scans 86 MB in 0.3 s because it only checks ~50 patterns. keyhog scans the same tree in 0.5 s with 899 patterns, catches 33% more real secrets, and pulls ahead on every dataset above ~200 MB (where the two-phase NFA wins big over linear regex). The right comparison is throughput per pattern at scale, not latency on a tiny tree.</p> </article> </main> </div> <footer class="site"> <div class="left"> <strong>keyhog</strong> · secret scanner by <a href="https://github.com/santhsecurity">santhsecurity</a>. MIT licensed. </div> <div class="right"> <a href="https://github.com/santhsecurity/keyhog">GitHub</a> <a href="https://crates.io/crates/keyhog">crates.io</a> <a href="https://github.com/santhsecurity/keyhog/issues">Issues</a> <a href="https://github.com/santhsecurity/keyhog/blob/main/CHANGELOG.md">Changelog</a> </div> </footer> <script src="js/nav.js" defer></script> </body> </html> |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |