A fast, safe, and efficient CBOR serialization library for Swift on any platform. swiftpackageindex.com/thecoolwinter/CBOR/1.1.1/documentation/cbor
atproto swift cbor
at 1.0.0 205 lines 13 kB view raw view rendered
1 2## Comparing results between 'swiftcbor' and 'Current_run' 3 4``` 5Host 'Khans-MacBook-Pro.local' with 10 'arm64' processors with 16 GB memory, running: 6Darwin Kernel Version 24.3.0: Thu Jan 2 20:24:16 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6000 7``` 8 9## Encoding 10 11### Array metrics 12 13<details><summary>Time (total CPU): results within specified thresholds, fold down for details.</summary> 14<p> 15 16| Time (total CPU) (μs) * | p0 | p25 | p50 | p75 | p90 | p99 | p100 | Samples | 17|:----------------------------------------:|----------:|----------:|----------:|----------:|----------:|----------:|----------:|----------:| 18| swiftcbor | 665 | 666 | 669 | 675 | 682 | 715 | 758 | 1383 | 19| Current_run | 470 | 471 | 471 | 474 | 481 | 501 | 535 | 2093 | 20| Δ | -195 | -195 | -198 | -201 | -201 | -214 | -223 | 710 | 21| Improvement % | 29 | 29 | 30 | 30 | 29 | 30 | 29 | 710 | 22 23<p> 24</details> 25 26### Array Small metrics 27 28<details><summary>Time (total CPU): results within specified thresholds, fold down for details.</summary> 29<p> 30 31| Time (total CPU) (ns) * | p0 | p25 | p50 | p75 | p90 | p99 | p100 | Samples | 32|:----------------------------------------:|----------:|----------:|----------:|----------:|----------:|----------:|----------:|----------:| 33| swiftcbor | 6874 | 7003 | 7043 | 7083 | 7167 | 7879 | 23417 | 10000 | 34| Current_run | 2749 | 2875 | 2917 | 2959 | 2959 | 3125 | 22791 | 10000 | 35| Δ | -4125 | -4128 | -4126 | -4124 | -4208 | -4754 | -626 | 0 | 36| Improvement % | 60 | 59 | 59 | 58 | 59 | 60 | 3 | 0 | 37 38<p> 39</details> 40 41### Bool metrics 42 43<details><summary>Time (total CPU): results within specified thresholds, fold down for details.</summary> 44<p> 45 46| Time (total CPU) (ns) * | p0 | p25 | p50 | p75 | p90 | p99 | p100 | Samples | 47|:----------------------------------------:|----------:|----------:|----------:|----------:|----------:|----------:|----------:|----------:| 48| swiftcbor | 3041 | 3167 | 3169 | 3209 | 3251 | 3583 | 18209 | 10000 | 49| Current_run | 1041 | 1124 | 1125 | 1126 | 1167 | 1292 | 8333 | 10000 | 50| Δ | -2000 | -2043 | -2044 | -2083 | -2084 | -2291 | -9876 | 0 | 51| Improvement % | 66 | 65 | 64 | 65 | 64 | 64 | 54 | 0 | 52 53<p> 54</details> 55 56### Complex Codable Object metrics 57 58<details><summary>Time (total CPU): results within specified thresholds, fold down for details.</summary> 59<p> 60 61| Time (total CPU) (μs) * | p0 | p25 | p50 | p75 | p90 | p99 | p100 | Samples | 62|:----------------------------------------:|----------:|----------:|----------:|----------:|----------:|----------:|----------:|----------:| 63| swiftcbor | 123 | 124 | 124 | 124 | 127 | 140 | 166 | 5760 | 64| Current_run | 91 | 92 | 92 | 92 | 94 | 99 | 122 | 10000 | 65| Δ | -32 | -32 | -32 | -32 | -33 | -41 | -44 | 4240 | 66| Improvement % | 26 | 26 | 26 | 26 | 26 | 29 | 27 | 4240 | 67 68<p> 69</details> 70 71### Data metrics 72 73<details><summary>Time (total CPU): results within specified thresholds, fold down for details.</summary> 74<p> 75 76| Time (total CPU) (ns) * | p0 | p25 | p50 | p75 | p90 | p99 | p100 | Samples | 77|:----------------------------------------:|----------:|----------:|----------:|----------:|----------:|----------:|----------:|----------:| 78| swiftcbor | 5168 | 5295 | 5335 | 5375 | 5459 | 6003 | 19667 | 10000 | 79| Current_run | 1125 | 1208 | 1250 | 1250 | 1292 | 1417 | 5584 | 10000 | 80| Δ | -4043 | -4087 | -4085 | -4125 | -4167 | -4586 | -14083 | 0 | 81| Improvement % | 78 | 77 | 77 | 77 | 76 | 76 | 72 | 0 | 82 83<p> 84</details> 85 86### Data Small metrics 87 88<details><summary>Time (total CPU): results within specified thresholds, fold down for details.</summary> 89<p> 90 91| Time (total CPU) (ns) * | p0 | p25 | p50 | p75 | p90 | p99 | p100 | Samples | 92|:----------------------------------------:|----------:|----------:|----------:|----------:|----------:|----------:|----------:|----------:| 93| swiftcbor | 3833 | 3917 | 3959 | 3959 | 4001 | 4375 | 21958 | 10000 | 94| Current_run | 916 | 959 | 1000 | 1000 | 1042 | 1167 | 4875 | 10000 | 95| Δ | -2917 | -2958 | -2959 | -2959 | -2959 | -3208 | -17083 | 0 | 96| Improvement % | 76 | 76 | 75 | 75 | 74 | 73 | 78 | 0 | 97 98<p> 99</details> 100 101### Dictionary metrics 102 103<details><summary>Time (total CPU): results within specified thresholds, fold down for details.</summary> 104<p> 105 106| Time (total CPU) (ns) * | p0 | p25 | p50 | p75 | p90 | p99 | p100 | Samples | 107|:----------------------------------------:|----------:|----------:|----------:|----------:|----------:|----------:|----------:|----------:| 108| swiftcbor | 11 | 11 | 11 | 11 | 11 | 14 | 31 | 10000 | 109| Current_run | 5 | 5 | 5 | 6 | 6 | 6 | 25 | 10000 | 110| Δ | -6 | -6 | -6 | -5 | -5 | -8 | -6 | 0 | 111| Improvement % | 55 | 55 | 55 | 45 | 45 | 57 | 19 | 0 | 112 113<p> 114</details> 115 116### Dictionary Small metrics 117 118<details><summary>Time (total CPU): results within specified thresholds, fold down for details.</summary> 119<p> 120 121| Time (total CPU) (ns) * | p0 | p25 | p50 | p75 | p90 | p99 | p100 | Samples | 122|:----------------------------------------:|----------:|----------:|----------:|----------:|----------:|----------:|----------:|----------:| 123| swiftcbor | 7292 | 7419 | 7459 | 7503 | 7667 | 8583 | 23833 | 10000 | 124| Current_run | 2750 | 2875 | 2959 | 3001 | 3125 | 3585 | 18375 | 10000 | 125| Δ | -4542 | -4544 | -4500 | -4502 | -4542 | -4998 | -5458 | 0 | 126| Improvement % | 62 | 61 | 60 | 60 | 59 | 58 | 23 | 0 | 127 128<p> 129</details> 130 131### Int metrics 132 133<details><summary>Time (total CPU): results within specified thresholds, fold down for details.</summary> 134<p> 135 136| Time (total CPU) (ns) * | p0 | p25 | p50 | p75 | p90 | p99 | p100 | Samples | 137|:----------------------------------------:|----------:|----------:|----------:|----------:|----------:|----------:|----------:|----------:| 138| swiftcbor | 3874 | 3959 | 4001 | 4043 | 4127 | 4835 | 21584 | 10000 | 139| Current_run | 1208 | 1291 | 1292 | 1333 | 1334 | 1459 | 15501 | 10000 | 140| Δ | -2666 | -2668 | -2709 | -2710 | -2793 | -3376 | -6083 | 0 | 141| Improvement % | 69 | 67 | 68 | 67 | 68 | 70 | 28 | 0 | 142 143<p> 144</details> 145 146### Int Small metrics 147 148<details><summary>Time (total CPU): results within specified thresholds, fold down for details.</summary> 149<p> 150 151| Time (total CPU) (ns) * | p0 | p25 | p50 | p75 | p90 | p99 | p100 | Samples | 152|:----------------------------------------:|----------:|----------:|----------:|----------:|----------:|----------:|----------:|----------:| 153| swiftcbor | 3708 | 3793 | 3833 | 3875 | 3917 | 4419 | 21792 | 10000 | 154| Current_run | 1124 | 1208 | 1208 | 1250 | 1250 | 1375 | 5458 | 10000 | 155| Δ | -2584 | -2585 | -2625 | -2625 | -2667 | -3044 | -16334 | 0 | 156| Improvement % | 70 | 68 | 68 | 68 | 68 | 69 | 75 | 0 | 157 158<p> 159</details> 160 161### Simple Codable Object metrics 162 163<details><summary>Time (total CPU): results within specified thresholds, fold down for details.</summary> 164<p> 165 166| Time (total CPU) (ns) * | p0 | p25 | p50 | p75 | p90 | p99 | p100 | Samples | 167|:----------------------------------------:|----------:|----------:|----------:|----------:|----------:|----------:|----------:|----------:| 168| swiftcbor | 17 | 18 | 18 | 18 | 18 | 23 | 43 | 10000 | 169| Current_run | 9 | 9 | 9 | 9 | 10 | 10 | 34 | 10000 | 170| Δ | -8 | -9 | -9 | -9 | -8 | -13 | -9 | 0 | 171| Improvement % | 47 | 50 | 50 | 50 | 44 | 57 | 21 | 0 | 172 173<p> 174</details> 175 176### String metrics 177 178<details><summary>Time (total CPU): results within specified thresholds, fold down for details.</summary> 179<p> 180 181| Time (total CPU) (ns) * | p0 | p25 | p50 | p75 | p90 | p99 | p100 | Samples | 182|:----------------------------------------:|----------:|----------:|----------:|----------:|----------:|----------:|----------:|----------:| 183| swiftcbor | 5416 | 5543 | 5583 | 5627 | 5667 | 6211 | 26459 | 10000 | 184| Current_run | 1166 | 1250 | 1291 | 1292 | 1333 | 1499 | 24125 | 10000 | 185| Δ | -4250 | -4293 | -4292 | -4335 | -4334 | -4712 | -2334 | 0 | 186| Improvement % | 78 | 77 | 77 | 77 | 76 | 76 | 9 | 0 | 187 188<p> 189</details> 190 191### String Small metrics 192 193<details><summary>Time (total CPU): results within specified thresholds, fold down for details.</summary> 194<p> 195 196| Time (total CPU) (ns) * | p0 | p25 | p50 | p75 | p90 | p99 | p100 | Samples | 197|:----------------------------------------:|----------:|----------:|----------:|----------:|----------:|----------:|----------:|----------:| 198| swiftcbor | 3916 | 4001 | 4041 | 4043 | 4085 | 4419 | 28084 | 10000 | 199| Current_run | 1000 | 1125 | 1125 | 1166 | 1167 | 1292 | 1834 | 10000 | 200| Δ | -2916 | -2876 | -2916 | -2877 | -2918 | -3127 | -26250 | 0 | 201| Improvement % | 74 | 72 | 72 | 71 | 71 | 71 | 93 | 0 | 202 203<p> 204</details> 205