Skip to content

feat(interp): add shell globbing benchmarks#142

Merged
AlexandreYang merged 2 commits intomainfrom
alex/glob-fix
Mar 24, 2026
Merged

feat(interp): add shell globbing benchmarks#142
AlexandreYang merged 2 commits intomainfrom
alex/glob-fix

Conversation

@AlexandreYang
Copy link
Copy Markdown
Member

Summary

  • Add 11 benchmarks covering shell glob expansion scenarios: star, prefix, suffix, question mark, bracket, nested, no-match, multiple patterns, for-loop iteration, and small/large directories
  • Add 3 memory-bounded assertion tests (TestGlob*MemoryBounded) that verify glob expansion stays within allocation ceilings
  • Goal: establish baselines to spot improvements, regressions, or places where tighter limits are needed

Benchmarks

Benchmark Scenario
BenchmarkGlobStar echo * in 1000-entry dir
BenchmarkGlobStarLargeDir echo * in 10000-entry dir
BenchmarkGlobPrefix echo file0* in 1000-entry dir
BenchmarkGlobSuffix echo *.txt in 1000-entry dir
BenchmarkGlobQuestionMark echo file????.txt in 1000-entry dir
BenchmarkGlobBracket echo file[0-4]*.txt in 1000-entry dir
BenchmarkGlobNested echo */* across 20 dirs × 50 files
BenchmarkGlobNoMatch echo *.xyz (no matches)
BenchmarkGlobMultiplePatterns 4 glob patterns in one command
BenchmarkGlobForLoop for f in *.txt; do :; done
BenchmarkGlobSmallDir echo * in 10-entry dir (baseline)

Test plan

  • go test ./interp/ -run "TestGlob.*MemoryBounded" passes
  • go test ./interp/ -bench "BenchmarkGlob" -benchmem runs successfully
  • CI passes

🤖 Generated with Claude Code

…tions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@AlexandreYang AlexandreYang marked this pull request as ready for review March 24, 2026 19:45
…chmark

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@AlexandreYang AlexandreYang added this pull request to the merge queue Mar 24, 2026
Merged via the queue into main with commit 3df7cde Mar 24, 2026
34 checks passed
@AlexandreYang AlexandreYang deleted the alex/glob-fix branch March 24, 2026 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants