Skip to content

Batch long Ice Lake UTF-8 validation blocks - #2814

Open
perfloop-agent wants to merge 2 commits into
simdjson:masterfrom
perfloop:perfloop-pr-open-jqmwgzc712
Open

Batch long Ice Lake UTF-8 validation blocks#2814
perfloop-agent wants to merge 2 commits into
simdjson:masterfrom
perfloop:perfloop-pr-open-jqmwgzc712

Conversation

@perfloop-agent

Copy link
Copy Markdown

Summary

Batch long UTF-8 validation requests in the Ice Lake implementation. For inputs of at least 64 KiB, the validator loads groups of 64-byte blocks and checks each block against its physical predecessor instead of carrying validation results through every vector operation. It retains only a three-byte suffix and an ASCII summary between groups, preserving checks at block joins and in the padded final block. Shorter requests continue to use the existing stateful path to avoid batch setup overhead.

Performance

On workload Ice Lake 64 KiB ASCII UTF-8 validation, median metric cpu_time_ns changed from 1376 to 1084; paired median delta -288.5 (-21% of baseline; at least 19/20 confidence interval -302.1 to -275 from 10 pairs).

On workload Ice Lake 1 MiB ASCII UTF-8 validation, median metric cpu_time_ns changed from 22664 to 17813; paired median delta -5016 (-22.1% of baseline; at least 19/20 confidence interval -5616 to -4324 from 10 pairs).

On workload Ice Lake 1 MiB multilingual UTF-8 validation, median metric cpu_time_ns changed from 68800 to 56998; paired median delta -11844 (-17.2% of baseline; at least 19/20 confidence interval -12787 to -10885 from 10 pairs).

On workload Ice Lake 64 KiB malformed UTF-8 at a 64-byte boundary, median metric cpu_time_ns changed from 1173 to 981.3; paired median delta -190.4 (-16.2% of baseline; at least 19/20 confidence interval -202.7 to -174.9 from 10 pairs).

On workload Ice Lake 1 MiB malformed UTF-8 at a 64-byte boundary, median metric cpu_time_ns changed from 19502 to 17171; paired median delta -2303 (-11.8% of baseline; at least 19/20 confidence interval -3343 to -1654 from 10 pairs).

Testing

Added differential coverage against the fallback implementation for long inputs, block boundaries, padded tails, dense multibyte data, and invalid mutations. Ran the CMake CTest suite with the Ice Lake implementation forced.

The declared correctness check passed.


Authored and verified by Perfloop: every claim above was co-measured on both trees and independently re-verified before submission — the full record is public: case_pg5w1h5y4k. Replies from this account are human-approved, and a human operator is accountable for this contribution.

@lemire

lemire commented Aug 12, 2026

Copy link
Copy Markdown
Member

Will need to be assessed manually. CI doesn't necessarily support avx-512.

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