Skip to content

Conversation

@dduan
Copy link
Owner

@dduan dduan commented Feb 6, 2026

Reduce overhead in Parser key lookup by removing nested withUnsafeBufferPointer closures in matchKeyValue/matchKeyArray/matchKeyTable.

Each matcher now opens one buffer pointer for backing storage and scans borrowed index lists with simple index-based loops and pointer advances.

Behavior is unchanged; this targets instruction count in repeated table/key lookup paths.

Reduce overhead in Parser key lookup by removing nested withUnsafeBufferPointer closures in matchKeyValue/matchKeyArray/matchKeyTable.

Each matcher now opens one buffer pointer for backing storage and scans borrowed index lists with simple index-based loops and pointer advances.

Behavior is unchanged; this targets instruction count in repeated table/key lookup paths.
@dduan dduan enabled auto-merge (squash) February 6, 2026 09:11
@github-actions
Copy link

github-actions bot commented Feb 6, 2026

Comparing results between 'main' and 'pull_request'

Host 'runnervmkj6or' with 4 'x86_64' processors with 15 GB memory, running:
#18~24.04.1-Ubuntu SMP Sat Jun 28 04:46:03 UTC 2025

TOMLDecoderBenchmarks

Decode toml.io example metrics

Time (wall clock): results within specified thresholds, fold down for details.

Time (wall clock) (μs) * p0 p25 p50 p75 p90 p99 p100 Samples
main 65 65 66 66 70 85 147 7344
pull_request 64 65 65 66 69 82 115 7360
Δ -1 0 -1 0 -1 -3 -32 16
Improvement % 2 0 2 0 1 4 22 16

Retains: results within specified thresholds, fold down for details.

Retains * p0 p25 p50 p75 p90 p99 p100 Samples
main 605 605 605 606 606 606 606 7344
pull_request 604 604 604 604 604 604 604 7360
Δ -1 -1 -1 -2 -2 -2 -2 16
Improvement % 0 0 0 0 0 0 0 16

Parse toml.io example metrics

Time (wall clock): results within specified thresholds, fold down for details.

Time (wall clock) (ns) * p0 p25 p50 p75 p90 p99 p100 Samples
main 5651 5783 5823 5871 5963 10351 31248 10000
pull_request 5530 5651 5691 5731 5803 9351 30156 10000
Δ -121 -132 -132 -140 -160 -1000 -1092 0
Improvement % 2 2 2 2 3 10 3 0

Retains: results within specified thresholds, fold down for details.

Retains * p0 p25 p50 p75 p90 p99 p100 Samples
main 13 14 14 14 14 14 14 10000
pull_request 13 14 14 14 14 14 14 10000
Δ 0 0 0 0 0 0 0 0
Improvement % 0 0 0 0 0 0 0 0

decode canada.toml metrics

Time (wall clock): results within specified thresholds, fold down for details.

Time (wall clock) (ms) * p0 p25 p50 p75 p90 p99 p100 Samples
main 263 263 264 264 266 266 266 4
pull_request 267 267 268 269 269 269 269 4
Δ 4 4 4 5 3 3 3 0
Improvement % -2 -2 -2 -2 -1 -1 -1 0

Retains: results within specified thresholds, fold down for details.

Retains (K) * p0 p25 p50 p75 p90 p99 p100 Samples
main 1674 1674 1674 1674 1674 1674 1674 4
pull_request 1674 1674 1674 1674 1674 1674 1674 4
Δ 0 0 0 0 0 0 0 0
Improvement % 0 0 0 0 0 0 0 0

decode twitter.toml metrics

Time (wall clock): results within specified thresholds, fold down for details.

Time (wall clock) (μs) * p0 p25 p50 p75 p90 p99 p100 Samples
main 8897 8921 8937 8962 8995 9265 9455 111
pull_request 8737 8782 8790 8815 8864 9093 9370 113
Δ -160 -139 -147 -147 -131 -172 -85 2
Improvement % 2 2 2 2 1 2 1 2

Retains: results within specified thresholds, fold down for details.

Retains (K) * p0 p25 p50 p75 p90 p99 p100 Samples
main 68 68 68 68 68 68 68 111
pull_request 68 68 68 68 68 68 68 113
Δ 0 0 0 0 0 0 0 2
Improvement % 0 0 0 0 0 0 0 2

parse GitHub events archive metrics

Time (wall clock): results within specified thresholds, fold down for details.

Time (wall clock) (ms) * p0 p25 p50 p75 p90 p99 p100 Samples
main 156 157 159 164 166 166 166 7
pull_request 153 153 154 154 155 155 155 7
Δ -3 -4 -5 -10 -11 -11 -11 0
Improvement % 2 3 3 6 7 7 7 0

Retains: results within specified thresholds, fold down for details.

Retains (K) * p0 p25 p50 p75 p90 p99 p100 Samples
main 150 150 150 150 150 150 150 7
pull_request 150 150 150 150 150 150 150 7
Δ 0 0 0 0 0 0 0 0
Improvement % 0 0 0 0 0 0 0 0

parse canada.toml metrics

Time (wall clock): results within specified thresholds, fold down for details.

Time (wall clock) (ms) * p0 p25 p50 p75 p90 p99 p100 Samples
main 16 16 16 18 29 31 31 53
pull_request 16 16 17 17 17 18 18 60
Δ 0 0 1 -1 -12 -13 -13 7
Improvement % 0 0 -6 6 41 42 42 7

Retains: results within specified thresholds, fold down for details.

Retains * p0 p25 p50 p75 p90 p99 p100 Samples
main 133 134 134 134 134 134 134 53
pull_request 133 134 134 134 134 134 134 60
Δ 0 0 0 0 0 0 0 7
Improvement % 0 0 0 0 0 0 0 7

parse twitter.toml metrics

Time (wall clock): results within specified thresholds, fold down for details.

Time (wall clock) (μs) * p0 p25 p50 p75 p90 p99 p100 Samples
main 2662 2679 2685 2695 3359 6500 6780 332
pull_request 2625 2638 2644 2654 2666 2867 3383 370
Δ -37 -41 -41 -41 -693 -3633 -3397 38
Improvement % 1 2 2 2 21 56 50 38

Retains: results within specified thresholds, fold down for details.

Retains * p0 p25 p50 p75 p90 p99 p100 Samples
main 3138 3139 3139 3139 3139 3139 3139 332
pull_request 3138 3139 3139 3139 3139 3139 3139 370
Δ 0 0 0 0 0 0 0 38
Improvement % 0 0 0 0 0 0 0 38

@dduan dduan merged commit b5a2f4b into main Feb 6, 2026
16 checks passed
@dduan dduan deleted the dd/flatten-key-lookup-pointer-loops branch February 6, 2026 09:21
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