Commit 9126b98
bench(assail): per-file UnboundedAllocation detector (Task #25)
Two new criterion benches for the word-boundary detector refactor:
unbounded_detector_clean_file — 262 µs
Synthetic file with tokio unbounded_channel + detector's own
identifiers (has_unbounded_allocations) + bounded .take(LIMIT)
read. Detector correctly does NOT fire. Exercises the negative
(disarmed) path.
unbounded_detector_dirty_file — 519 µs
Bare `fn unbounded()` + unbounded std::fs::read_to_string.
Detector correctly DOES fire. Exercises the positive path,
which also walks all alarm-keyword regexes that are triggered.
For reference:
assail_self_scan — 55 ms (full src/ walk, ~85 files)
clean_file — 262 µs (single-file equivalent ≈ 3 ms/file
when amortised over a full walk)
The regex-initialisation overhead is fully amortised: every regex
is wrapped in OnceLock and compiled once per process.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent e199ef3 commit 9126b98
1 file changed
Lines changed: 79 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 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 | + | |
84 | 162 | | |
85 | 163 | | |
86 | 164 | | |
| |||
164 | 242 | | |
165 | 243 | | |
166 | 244 | | |
| 245 | + | |
167 | 246 | | |
168 | 247 | | |
169 | 248 | | |
| |||
0 commit comments