Skip to content

[Experimental] SIMD nonsense - #2

Open
ahrav wants to merge 2 commits into
masterfrom
exp-simd-nonsense
Open

[Experimental] SIMD nonsense#2
ahrav wants to merge 2 commits into
masterfrom
exp-simd-nonsense

Conversation

@ahrav

@ahrav ahrav commented Jan 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add SIMD root-state prefilter (GOEXPERIMENT=simd + AVX) to skip non-candidate bytes. Kinda a bummer this only works on AMD :(
  • Non-SIMD builds unchanged.

Benchmarks

linux/amd64, go1.26rc2, AMD Ryzen 9 9950X

Commands:

go test -bench=BenchmarkMatchIbsen -benchmem -run=^$ -count=6 ./...
GOEXPERIMENT=simd go test -bench=BenchmarkMatchIbsen -benchmem -run=^$ -count=6 ./...

Time (sec/op)

Benchmark nosimd simd delta
MatchIbsen/100-32 197.15n ± 1% 99.34n ± 7% -49.61% (p=0.002 n=6)
MatchIbsen/1000-32 1825.5n ± 1% 703.7n ± 4% -61.45% (p=0.002 n=6)
MatchIbsen/10000-32 19.174us ± 0% 7.938us ± 0% -58.60% (p=0.002 n=6)
MatchIbsen/100000-32 199.97us ± 0% 95.25us ± 1% -52.37% (p=0.002 n=6)
geomean 6.095us 2.696us -55.76%

Memory

B/op and allocs/op unchanged for 100, 1000, 10000; 100000 B/op improves -34.59% (p=0.002 n=6).

AhravDutta and others added 2 commits January 21, 2026 20:46
Add support for Go 1.26's experimental `simd/archsimd` package
to accelerate root-state skipping when the pattern set has 16 or
fewer distinct starting bytes. This feature is only available on
@ahrav

ahrav commented Jan 22, 2026

Copy link
Copy Markdown
Owner Author

@codex

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

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.

1 participant