kaizen: Add BenchmarkShellStyleBuildTime using testing.B#495
Merged
timbray merged 3 commits intotimbray:mainfrom Feb 19, 2026
Merged
kaizen: Add BenchmarkShellStyleBuildTime using testing.B#495timbray merged 3 commits intotimbray:mainfrom
timbray merged 3 commits intotimbray:mainfrom
Conversation
Convert the manual TestShellStyleBuildTime timing into a proper Go 1.24 b.Loop() benchmark. Uses 1000 shell-style wildcard patterns merged onto a single field, producing an automaton with 7409 tables and up to 900 epsilons—a stress test for NFA traversal at scale. Also widen readWWords to accept testing.TB so it works from both tests and benchmarks. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
timbray
reviewed
Feb 18, 2026
v2_bench_test.go
Outdated
| } | ||
|
|
||
| func BenchmarkShellStyleBuildTime(b *testing.B) { | ||
| words := readWWords(b)[:1000] |
Owner
There was a problem hiding this comment.
There are almost 13K words in that file, I've been meaning for months to parameterize the readWords function so we don't read 13K and throw away 12K. Pretty please?
Add maxWords parameter so callers that only need a subset (1000 or 2000 words) don't read all 13K lines from wwords.txt. Pass 0 to read all words. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Convert the manual TestShellStyleBuildTime timing into a proper Go 1.24 b.Loop() benchmark. Uses 1000 shell-style wildcard patterns merged onto a single field, producing an automaton with 7409 tables and up to 900 epsilons—a stress test for NFA traversal at scale. First step for #494.
Also widen readWWords to accept testing.TB so it works from both tests and benchmarks.