Skip to content

Conversation

@dduan
Copy link
Owner

@dduan dduan commented Feb 6, 2026

Switch Token.Kind and InternalTOMLArray.Kind to UInt8-backed enums. The parser compares these enums in tight loops, and smaller enum storage can improve code generation and reduce data movement without changing semantics.

Switch Token.Kind and InternalTOMLArray.Kind to UInt8-backed enums. The parser compares these enums in tight loops, and smaller enum storage can improve code generation and reduce data movement without changing semantics.
@dduan dduan enabled auto-merge (squash) February 6, 2026 18:18
@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 66 66 66 70 83 122 7330
pull_request 64 65 66 66 70 84 124 7338
Δ -1 -1 0 0 0 1 2 8
Improvement % 2 2 0 0 0 -1 -2 8

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

Retains * p0 p25 p50 p75 p90 p99 p100 Samples
main 605 605 605 605 605 605 605 7330
pull_request 604 604 604 604 604 604 604 7338
Δ -1 -1 -1 -1 -1 -1 -1 8
Improvement % 0 0 0 0 0 0 0 8

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 5440 5531 5551 5603 5643 6723 24105 10000
pull_request 5540 5671 5711 5751 5823 7635 23814 10000
Δ 100 140 160 148 180 912 -291 0
Improvement % -2 -3 -3 -3 -3 -14 1 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 265 265 267 267 268 268 268 4
pull_request 266 266 267 267 267 267 267 4
Δ 1 1 0 0 -1 -1 -1 0
Improvement % 0 0 0 0 0 0 0 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 8781 8806 8823 8839 8897 9142 9457 113
pull_request 8808 8847 8856 8880 8929 9433 9433 112
Δ 27 41 33 41 32 291 -24 -1
Improvement % 0 0 0 0 0 -3 0 -1

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 113
pull_request 68 68 68 68 68 68 68 112
Δ 0 0 0 0 0 0 0 -1
Improvement % 0 0 0 0 0 0 0 -1

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 154 155 155 161 161 161 161 7
pull_request 153 153 154 154 157 157 157 7
Δ -1 -2 -1 -7 -4 -4 -4 0
Improvement % 1 1 1 4 2 2 2 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 17 17 17 17 18 18 60
pull_request 16 17 17 17 17 18 18 59
Δ 0 0 0 0 0 0 0 -1
Improvement % 0 0 0 0 0 0 0 -1

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 60
pull_request 133 134 134 134 134 134 134 59
Δ 0 0 0 0 0 0 0 -1
Improvement % 0 0 0 0 0 0 0 -1

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 2644 2658 2664 2677 2691 2761 3351 367
pull_request 2592 2609 2617 2628 2652 2892 3405 374
Δ -52 -49 -47 -49 -39 131 54 7
Improvement % 2 2 2 2 1 -5 -2 7

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 367
pull_request 3138 3139 3139 3139 3139 3139 3139 374
Δ 0 0 0 0 0 0 0 7
Improvement % 0 0 0 0 0 0 0 7

@dduan dduan merged commit b4c5efb into main Feb 6, 2026
16 checks passed
@dduan dduan deleted the dd/use-uint8-storage-for-hot-parser-enums branch February 6, 2026 18:26
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