Repository navigation
perf: accelerate C906 WebSocket masking - #497
Open
dormancygrace wants to merge 1 commit into
Open
dormancygrace wants to merge 1 commit into
dormancygrace wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Browser-originated WebSocket frames use Gorilla's generic word-at-a-time masking loop. Add a C906 path that keeps 0–7 bytes in Go, handles 8–127 bytes with scalar assembly, and uses XTheadVector from 128 bytes while preserving phase and exact buffer bounds.
The server builder stages the pinned Gorilla v1.5.3 package under its output and uses a private modfile. The shared module cache stays intact; the build verifies the linked assembly and records its source hashes. Runtime checks require XTheadVector, enabled vector state and fast misaligned accesses, with an explicit generic control.
Validation on SG2002/C906, Ethernet and video enabled, three processes with three repetitions and medians:
CI checks the generated instructions, module staging, fallback tests and target test compilation. The test-only CONNECT fixture uses a real tunnel for Go 1.27, and prepared-message tests retain their intended deterministic seeds; no assertions were removed.
Methodology, process medians and qualification hashes are in firmware/cpu/go-websocket-c906/. Memory clearing remains a separate investigation and is not changed by this PR.