Skip to content

Create 'CodableSupport' trait for embedded#316

Open
dduan wants to merge 13 commits intomainfrom
dd/embedded
Open

Create 'CodableSupport' trait for embedded#316
dduan wants to merge 13 commits intomainfrom
dd/embedded

Conversation

@dduan
Copy link
Owner

@dduan dduan commented Feb 7, 2026

CodableSupport is a trait that's by default enabled. The Codable related APIs are enabled by this trait. When this trait is not enabled, the lower level parsing API remain available, and that portion must not depend on Foundation. All the stand test should pass for non-CodableSupport potion of the library. The non-CodableSupport APIs should function for embedded Swift.

Few things needs to happen before this gets merged:

  • A reliable CI check for running tests without the default trait
  • A CI build for embedded Swift of the non-CodableSupport part
  • Documentation updates:
    • A mention of embedded support in introductory materials
    • An explanation of the trait
    • Per API annotation about availability for embeded (or trait membership?)
    • A dedicated article for embeded.
    • developer docs
    • change log updates
  • An test on an actual embeded device :)

Closes #232
Closes #227

`CodableSupport` is a trait that's by default enabled.
The Codable related APIs are enabled by this trait.
When this trait is not enabled, the lower level parsing API remain
available, and that portion must not depend on Foundation.
All the stand test should pass for non-`CodableSupport` potion of the library.
The non-`CodableSupport` APIs should function for embedded Swift.

Few things needs to happen before this gets merged:

- [ ] A reliable CI check for running tests without the default trait
- [ ] A CI build for embedded Swift of the non-`CodableSupport` part
- [ ] Documentation updates:
    - [ ] A mention of embedded support in introductory materials
    - [ ] An explanation of the trait
    - [ ] Per API annotation about availability for embeded (or trait membership?)
    - [ ] A dedicated article for embeded.
- [ ] An test on an actual embeded device :)

Closes #232
Closes #227
@github-actions
Copy link

github-actions bot commented Feb 7, 2026

Comparing results between 'main' and 'pull_request'

Host 'runnervmwffz4' 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 70 71 71 74 81 98 150 6976
pull_request 70 71 71 74 80 98 165 6964
Δ 0 0 0 0 -1 0 15 -12
Improvement % 0 0 0 0 1 0 -10 -12

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

Retains * p0 p25 p50 p75 p90 p99 p100 Samples
main 860 860 860 860 860 860 860 6976
pull_request 859 859 859 860 860 860 860 6964
Δ -1 -1 -1 0 0 0 0 -12
Improvement % 0 0 0 0 0 0 0 -12

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 4778 4879 4919 4963 5111 8047 25869 10000
pull_request 4859 4979 5019 5071 5191 7947 41998 10000
Δ 81 100 100 108 80 -100 16129 0
Improvement % -2 -2 -2 -2 -2 1 -62 0

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

Retains * p0 p25 p50 p75 p90 p99 p100 Samples
main 11 12 12 12 12 12 12 10000
pull_request 10 11 11 11 11 11 11 10000
Δ -1 -1 -1 -1 -1 -1 -1 0
Improvement % 9 8 8 8 8 8 8 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 262 263 265 265 268 268 268 4
pull_request 263 263 266 267 267 267 267 4
Δ 1 0 1 2 -1 -1 -1 0
Improvement % 0 0 0 -1 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 9652 9708 9740 9765 9839 13787 16520 100
pull_request 9564 9609 9650 9699 9757 10174 10245 103
Δ -88 -99 -90 -66 -82 -3613 -6275 3
Improvement % 1 1 1 1 1 26 38 3

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

Retains (K) * p0 p25 p50 p75 p90 p99 p100 Samples
main 114 114 114 114 114 114 114 100
pull_request 114 114 114 114 114 114 114 103
Δ 0 0 0 0 0 0 0 3
Improvement % 0 0 0 0 0 0 0 3

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 133 133 133 133 136 136 136 8
pull_request 142 146 148 150 150 150 150 7
Δ 9 13 15 17 14 14 14 -1
Improvement % -7 -10 -11 -13 -10 -10 -10 -1

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

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

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 17 17 18 18 61
pull_request 17 17 17 17 18 19 19 59
Δ 1 1 1 0 1 1 1 -2
Improvement % -6 -6 -6 0 -6 -6 -6 -2

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

Retains * p0 p25 p50 p75 p90 p99 p100 Samples
main 131 132 132 132 132 132 132 61
pull_request 130 131 131 131 131 131 131 59
Δ -1 -1 -1 -1 -1 -1 -1 -2
Improvement % 1 1 1 1 1 1 1 -2

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 2232 2253 2263 2275 2292 2392 3024 431
pull_request 2265 2284 2292 2306 2324 2384 2836 425
Δ 33 31 29 31 32 -8 -188 -6
Improvement % -1 -1 -1 -1 -1 0 6 -6

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

Retains * p0 p25 p50 p75 p90 p99 p100 Samples
main 3757 3758 3758 3758 3758 3758 3758 431
pull_request 3756 3757 3757 3757 3757 3757 3757 425
Δ -1 -1 -1 -1 -1 -1 -1 -6
Improvement % 0 0 0 0 0 0 0 -6

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.

dependency on Foundation should be a trait Define availability for embedded Swift

1 participant