Skip to content

Flatten bytes to sort#9

Merged
frankmcsherry merged 1 commit into
mainfrom
flatten_bytes
Oct 20, 2025
Merged

Flatten bytes to sort#9
frankmcsherry merged 1 commit into
mainfrom
flatten_bytes

Conversation

@frankmcsherry
Copy link
Copy Markdown
Owner

The presentation of &mut [[[u8;4];3]] to sort was antagonizing Rust, which treats it differently than a &mut [[u8;12]]. This PR flattens the representation to a Vec<u8> and then blocks it out differently using as_chunks_mut depending on the need. Improves times from ~18s to ~17.5s.

From an investigation prompted by @DAlperin. The investigation suggests there are still a lot more instructions going on than are probably required; e.g. going from counting lower .. upper back to 0 .. R::WIDTH results in two instructions for each byte, vs a whole bunch. Haven't turned this in to measurable performance improvements yet though.

@frankmcsherry frankmcsherry merged commit 504094d into main Oct 20, 2025
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