| 1 |
# Fiber Utils |
| 2 |
|
| 3 |
 |
| 4 |
 |
| 5 |
 |
| 6 |
 |
| 7 |
[](https://gofiber.github.io/utils/benchmarks/) |
| 8 |
[](https://gofiber.io/discord) |
| 9 |
|
| 10 |
A collection of common functions for [Fiber](https://github.com/gofiber/fiber) with better performance, fewer allocations, and fewer dependencies. |
| 11 |
|
| 12 |
## Benchmarks |
| 13 |
|
| 14 |
Per-commit benchmark charts: <https://gofiber.github.io/utils/benchmarks/> |
| 15 |
|
| 16 |
Environment: |
| 17 |
goos: darwin |
| 18 |
goarch: arm64 |
| 19 |
pkg: github.com/gofiber/utils/v2 |
| 20 |
cpu: Apple M2 Pro |
| 21 |
|
| 22 |
```text |
| 23 |
// go test ./... -benchmem -run=^$ -bench=Benchmark_ -count=1 |
| 24 |
// (swar's Benchmark_Load8_Fusion, an advisory codegen guard, is deliberately omitted) |
| 25 |
|
| 26 |
# Case Conversion |
| 27 |
Benchmark_ToLowerBytes/empty/fiber-12 599341221 1.970 ns/op 0 B/op 0 allocs/op |
| 28 |
Benchmark_ToLowerBytes/empty/fiber/unsafe-12 613673802 1.951 ns/op 0 B/op 0 allocs/op |
| 29 |
Benchmark_ToLowerBytes/empty/default-12 363300402 3.316 ns/op 0 B/op 0 allocs/op |
| 30 |
Benchmark_ToLowerBytes/http-get/fiber-12 350302147 3.434 ns/op 0 B/op 0 allocs/op |
| 31 |
Benchmark_ToLowerBytes/http-get/fiber/unsafe-12 250488015 4.803 ns/op 0 B/op 0 allocs/op |
| 32 |
Benchmark_ToLowerBytes/http-get/default-12 65883986 18.03 ns/op 8 B/op 1 allocs/op |
| 33 |
Benchmark_ToLowerBytes/http-get-upper/fiber-12 95234625 12.53 ns/op 3 B/op 1 allocs/op |
| 34 |
Benchmark_ToLowerBytes/http-get-upper/fiber/unsafe-12 242418936 4.802 ns/op 0 B/op 0 allocs/op |
| 35 |
Benchmark_ToLowerBytes/http-get-upper/default-12 86405012 13.85 ns/op 8 B/op 1 allocs/op |
| 36 |
Benchmark_ToLowerBytes/header-content-type-mixed/fiber-12 52263289 22.74 ns/op 48 B/op 1 allocs/op |
| 37 |
Benchmark_ToLowerBytes/header-content-type-mixed/fiber/unsafe-12 131711175 9.101 ns/op 0 B/op 0 allocs/op |
| 38 |
Benchmark_ToLowerBytes/header-content-type-mixed/default-12 25312339 47.13 ns/op 48 B/op 1 allocs/op |
| 39 |
Benchmark_ToLowerBytes/large-lower/fiber-12 120148472 10.02 ns/op 0 B/op 0 allocs/op |
| 40 |
Benchmark_ToLowerBytes/large-lower/fiber/unsafe-12 100000000 10.57 ns/op 0 B/op 0 allocs/op |
| 41 |
Benchmark_ToLowerBytes/large-lower/default-12 16746064 71.43 ns/op 64 B/op 1 allocs/op |
| 42 |
Benchmark_ToLowerBytes/large-upper/fiber-12 46270634 26.82 ns/op 64 B/op 1 allocs/op |
| 43 |
Benchmark_ToLowerBytes/large-upper/fiber/unsafe-12 100000000 10.71 ns/op 0 B/op 0 allocs/op |
| 44 |
Benchmark_ToLowerBytes/large-upper/default-12 15734505 76.92 ns/op 64 B/op 1 allocs/op |
| 45 |
Benchmark_ToLowerBytes/large-mixed/fiber-12 46607823 26.06 ns/op 64 B/op 1 allocs/op |
| 46 |
Benchmark_ToLowerBytes/large-mixed/fiber/unsafe-12 100000000 10.86 ns/op 0 B/op 0 allocs/op |
| 47 |
Benchmark_ToLowerBytes/large-mixed/default-12 16291084 73.76 ns/op 64 B/op 1 allocs/op |
| 48 |
Benchmark_ToUpperBytes/empty/fiber-12 607678140 1.976 ns/op 0 B/op 0 allocs/op |
| 49 |
Benchmark_ToUpperBytes/empty/fiber/unsafe-12 611928006 1.981 ns/op 0 B/op 0 allocs/op |
| 50 |
Benchmark_ToUpperBytes/empty/default-12 362632894 3.309 ns/op 0 B/op 0 allocs/op |
| 51 |
Benchmark_ToUpperBytes/http-get/fiber-12 95358867 12.55 ns/op 3 B/op 1 allocs/op |
| 52 |
Benchmark_ToUpperBytes/http-get/fiber/unsafe-12 249490471 4.905 ns/op 0 B/op 0 allocs/op |
| 53 |
Benchmark_ToUpperBytes/http-get/default-12 79248020 14.63 ns/op 8 B/op 1 allocs/op |
| 54 |
Benchmark_ToUpperBytes/http-get-upper/fiber-12 365516280 3.330 ns/op 0 B/op 0 allocs/op |
| 55 |
Benchmark_ToUpperBytes/http-get-upper/fiber/unsafe-12 249981619 4.803 ns/op 0 B/op 0 allocs/op |
| 56 |
Benchmark_ToUpperBytes/http-get-upper/default-12 64343162 19.01 ns/op 8 B/op 1 allocs/op |
| 57 |
Benchmark_ToUpperBytes/header-content-type-mixed/fiber-12 52506741 22.69 ns/op 48 B/op 1 allocs/op |
| 58 |
Benchmark_ToUpperBytes/header-content-type-mixed/fiber/unsafe-12 130478352 9.350 ns/op 0 B/op 0 allocs/op |
| 59 |
Benchmark_ToUpperBytes/header-content-type-mixed/default-12 22415607 54.44 ns/op 48 B/op 1 allocs/op |
| 60 |
Benchmark_ToUpperBytes/large-lower/fiber-12 44765679 26.92 ns/op 64 B/op 1 allocs/op |
| 61 |
Benchmark_ToUpperBytes/large-lower/fiber/unsafe-12 100000000 13.68 ns/op 0 B/op 0 allocs/op |
| 62 |
Benchmark_ToUpperBytes/large-lower/default-12 14464340 110.7 ns/op 64 B/op 1 allocs/op |
| 63 |
Benchmark_ToUpperBytes/large-upper/fiber-12 100000000 11.98 ns/op 0 B/op 0 allocs/op |
| 64 |
Benchmark_ToUpperBytes/large-upper/fiber/unsafe-12 83808488 13.94 ns/op 0 B/op 0 allocs/op |
| 65 |
Benchmark_ToUpperBytes/large-upper/default-12 13142096 87.35 ns/op 64 B/op 1 allocs/op |
| 66 |
Benchmark_ToUpperBytes/large-mixed/fiber-12 33038661 32.75 ns/op 64 B/op 1 allocs/op |
| 67 |
Benchmark_ToUpperBytes/large-mixed/fiber/unsafe-12 100000000 10.93 ns/op 0 B/op 0 allocs/op |
| 68 |
Benchmark_ToUpperBytes/large-mixed/default-12 15034422 98.27 ns/op 64 B/op 1 allocs/op |
| 69 |
Benchmark_ToUpper/empty/fiber-12 595298628 2.309 ns/op 0 B/op 0 allocs/op |
| 70 |
Benchmark_ToUpper/empty/fiber/unsafe-12 595273404 2.021 ns/op 0 B/op 0 allocs/op |
| 71 |
Benchmark_ToUpper/empty/default-12 636980288 1.883 ns/op 0 B/op 0 allocs/op |
| 72 |
Benchmark_ToUpper/http-get/fiber-12 97025577 12.40 ns/op 3 B/op 1 allocs/op |
| 73 |
Benchmark_ToUpper/http-get/fiber/unsafe-12 244711635 4.857 ns/op 0 B/op 0 allocs/op |
| 74 |
Benchmark_ToUpper/http-get/default-12 59790234 19.54 ns/op 8 B/op 1 allocs/op |
| 75 |
Benchmark_ToUpper/http-get-upper/fiber-12 383218539 3.056 ns/op 0 B/op 0 allocs/op |
| 76 |
Benchmark_ToUpper/http-get-upper/fiber/unsafe-12 247851331 4.864 ns/op 0 B/op 0 allocs/op |
| 77 |
Benchmark_ToUpper/http-get-upper/default-12 223044249 5.182 ns/op 0 B/op 0 allocs/op |
| 78 |
Benchmark_ToUpper/header-content-type-mixed/fiber-12 52628502 24.13 ns/op 48 B/op 1 allocs/op |
| 79 |
Benchmark_ToUpper/header-content-type-mixed/fiber/unsafe-12 127726341 9.233 ns/op 0 B/op 0 allocs/op |
| 80 |
Benchmark_ToUpper/header-content-type-mixed/default-12 11549816 104.0 ns/op 48 B/op 1 allocs/op |
| 81 |
Benchmark_ToUpper/large-lower/fiber-12 42409070 26.04 ns/op 64 B/op 1 allocs/op |
| 82 |
Benchmark_ToUpper/large-lower/fiber/unsafe-12 100000000 11.00 ns/op 0 B/op 0 allocs/op |
| 83 |
Benchmark_ToUpper/large-lower/default-12 7051911 169.0 ns/op 64 B/op 1 allocs/op |
| 84 |
Benchmark_ToUpper/large-upper/fiber-12 123837582 9.590 ns/op 0 B/op 0 allocs/op |
| 85 |
Benchmark_ToUpper/large-upper/fiber/unsafe-12 100000000 10.83 ns/op 0 B/op 0 allocs/op |
| 86 |
Benchmark_ToUpper/large-upper/default-12 19115356 61.51 ns/op 0 B/op 0 allocs/op |
| 87 |
Benchmark_ToUpper/large-mixed/fiber-12 45872143 27.77 ns/op 64 B/op 1 allocs/op |
| 88 |
Benchmark_ToUpper/large-mixed/fiber/unsafe-12 100000000 11.00 ns/op 0 B/op 0 allocs/op |
| 89 |
Benchmark_ToUpper/large-mixed/default-12 5927710 203.1 ns/op 64 B/op 1 allocs/op |
| 90 |
Benchmark_ToLower/empty/fiber-12 613625554 1.952 ns/op 0 B/op 0 allocs/op |
| 91 |
Benchmark_ToLower/empty/fiber/unsafe-12 572670608 1.989 ns/op 0 B/op 0 allocs/op |
| 92 |
Benchmark_ToLower/empty/default-12 644769141 1.863 ns/op 0 B/op 0 allocs/op |
| 93 |
Benchmark_ToLower/http-get/fiber-12 395302272 3.034 ns/op 0 B/op 0 allocs/op |
| 94 |
Benchmark_ToLower/http-get/fiber/unsafe-12 252231990 4.813 ns/op 0 B/op 0 allocs/op |
| 95 |
Benchmark_ToLower/http-get/default-12 284202345 4.219 ns/op 0 B/op 0 allocs/op |
| 96 |
Benchmark_ToLower/http-get-upper/fiber-12 100000000 12.08 ns/op 3 B/op 1 allocs/op |
| 97 |
Benchmark_ToLower/http-get-upper/fiber/unsafe-12 252859507 4.816 ns/op 0 B/op 0 allocs/op |
| 98 |
Benchmark_ToLower/http-get-upper/default-12 60415860 19.54 ns/op 8 B/op 1 allocs/op |
| 99 |
Benchmark_ToLower/header-content-type-mixed/fiber-12 53446660 22.49 ns/op 48 B/op 1 allocs/op |
| 100 |
Benchmark_ToLower/header-content-type-mixed/fiber/unsafe-12 131152108 9.153 ns/op 0 B/op 0 allocs/op |
| 101 |
Benchmark_ToLower/header-content-type-mixed/default-12 18039788 66.79 ns/op 48 B/op 1 allocs/op |
| 102 |
Benchmark_ToLower/large-lower/fiber-12 120227584 9.982 ns/op 0 B/op 0 allocs/op |
| 103 |
Benchmark_ToLower/large-lower/fiber/unsafe-12 100000000 10.68 ns/op 0 B/op 0 allocs/op |
| 104 |
Benchmark_ToLower/large-lower/default-12 24070928 48.79 ns/op 0 B/op 0 allocs/op |
| 105 |
Benchmark_ToLower/large-upper/fiber-12 44699118 25.92 ns/op 64 B/op 1 allocs/op |
| 106 |
Benchmark_ToLower/large-upper/fiber/unsafe-12 100000000 10.74 ns/op 0 B/op 0 allocs/op |
| 107 |
Benchmark_ToLower/large-upper/default-12 7075200 170.0 ns/op 64 B/op 1 allocs/op |
| 108 |
Benchmark_ToLower/large-mixed/fiber-12 46426453 26.01 ns/op 64 B/op 1 allocs/op |
| 109 |
Benchmark_ToLower/large-mixed/fiber/unsafe-12 100000000 10.74 ns/op 0 B/op 0 allocs/op |
| 110 |
Benchmark_ToLower/large-mixed/default-12 5682778 204.3 ns/op 64 B/op 1 allocs/op |
| 111 |
|
| 112 |
# Add Trailing Slash |
| 113 |
Benchmark_AddTrailingSlashBytes/empty-12 1000000000 0.5857 ns/op 0 B/op 0 allocs/op |
| 114 |
Benchmark_AddTrailingSlashBytes/slash-only-12 1000000000 0.8694 ns/op 0 B/op 0 allocs/op |
| 115 |
Benchmark_AddTrailingSlashBytes/short-no-slash-12 100000000 11.65 ns/op 4 B/op 1 allocs/op |
| 116 |
Benchmark_AddTrailingSlashBytes/short-with-slash-12 1000000000 0.8867 ns/op 0 B/op 0 allocs/op |
| 117 |
Benchmark_AddTrailingSlashBytes/path-no-slash-12 93543546 13.36 ns/op 16 B/op 1 allocs/op |
| 118 |
Benchmark_AddTrailingSlashBytes/path-with-slash-12 1000000000 0.9011 ns/op 0 B/op 0 allocs/op |
| 119 |
Benchmark_AddTrailingSlashString/empty-12 1000000000 0.2926 ns/op 0 B/op 0 allocs/op |
| 120 |
Benchmark_AddTrailingSlashString/slash-only-12 1000000000 0.4482 ns/op 0 B/op 0 allocs/op |
| 121 |
Benchmark_AddTrailingSlashString/short-no-slash-12 100000000 11.37 ns/op 4 B/op 1 allocs/op |
| 122 |
Benchmark_AddTrailingSlashString/short-with-slash-12 1000000000 0.4502 ns/op 0 B/op 0 allocs/op |
| 123 |
Benchmark_AddTrailingSlashString/path-no-slash-12 82427726 14.41 ns/op 16 B/op 1 allocs/op |
| 124 |
Benchmark_AddTrailingSlashString/path-with-slash-12 1000000000 0.4529 ns/op 0 B/op 0 allocs/op |
| 125 |
|
| 126 |
# EqualFold |
| 127 |
Benchmark_EqualFoldBytes/fiber-12 67368261 18.48 ns/op 0 B/op 0 allocs/op |
| 128 |
Benchmark_EqualFoldBytes/default-12 17774803 65.91 ns/op 0 B/op 0 allocs/op |
| 129 |
Benchmark_EqualFold/fiber-12 80501566 14.75 ns/op 0 B/op 0 allocs/op |
| 130 |
Benchmark_EqualFold/default-12 18314365 65.96 ns/op 0 B/op 0 allocs/op |
| 131 |
|
| 132 |
# Search |
| 133 |
// amd64 note: IndexAny2/IndexAny3 dispatch to package simd for 32+ byte |
| 134 |
// inputs; these arm64 rows keep the portable SWAR path. For amd64 numbers |
| 135 |
// see the Benchmark_Memchr2/Benchmark_Memchr3 rows in the simd section |
| 136 |
// below (the kernels these functions dispatch to). |
| 137 |
Benchmark_IndexAny2/7B/swar-12 282163779 4.297 ns/op 0 B/op 0 allocs/op |
| 138 |
Benchmark_IndexAny2/7B/scalar-12 314553402 3.826 ns/op 0 B/op 0 allocs/op |
| 139 |
Benchmark_IndexAny2/7B/stdlib-indexany-12 50085909 23.97 ns/op 0 B/op 0 allocs/op |
| 140 |
Benchmark_IndexAny2/8B/swar-12 522780714 2.289 ns/op 0 B/op 0 allocs/op |
| 141 |
Benchmark_IndexAny2/8B/scalar-12 271494799 4.206 ns/op 0 B/op 0 allocs/op |
| 142 |
Benchmark_IndexAny2/8B/stdlib-indexany-12 44831599 26.78 ns/op 0 B/op 0 allocs/op |
| 143 |
Benchmark_IndexAny2/16B/swar-12 393245086 3.047 ns/op 0 B/op 0 allocs/op |
| 144 |
Benchmark_IndexAny2/16B/scalar-12 168476984 7.117 ns/op 0 B/op 0 allocs/op |
| 145 |
Benchmark_IndexAny2/16B/stdlib-indexany-12 100000000 10.03 ns/op 0 B/op 0 allocs/op |
| 146 |
Benchmark_IndexAny2/32B/swar-12 252199587 4.802 ns/op 0 B/op 0 allocs/op |
| 147 |
Benchmark_IndexAny2/32B/scalar-12 84105762 14.27 ns/op 0 B/op 0 allocs/op |
| 148 |
Benchmark_IndexAny2/32B/stdlib-indexany-12 70291048 17.37 ns/op 0 B/op 0 allocs/op |
| 149 |
Benchmark_IndexAny2/64B/swar-12 144335962 8.290 ns/op 0 B/op 0 allocs/op |
| 150 |
Benchmark_IndexAny2/64B/scalar-12 42694686 28.60 ns/op 0 B/op 0 allocs/op |
| 151 |
Benchmark_IndexAny2/64B/stdlib-indexany-12 37615540 32.23 ns/op 0 B/op 0 allocs/op |
| 152 |
Benchmark_IndexAny2/512B/swar-12 20231538 59.71 ns/op 0 B/op 0 allocs/op |
| 153 |
Benchmark_IndexAny2/512B/scalar-12 5071586 233.6 ns/op 0 B/op 0 allocs/op |
| 154 |
Benchmark_IndexAny2/512B/stdlib-indexany-12 4448119 274.2 ns/op 0 B/op 0 allocs/op |
| 155 |
Benchmark_IndexAny3/7B/swar-12 221889592 5.397 ns/op 0 B/op 0 allocs/op |
| 156 |
Benchmark_IndexAny3/7B/scalar-12 240859849 4.977 ns/op 0 B/op 0 allocs/op |
| 157 |
Benchmark_IndexAny3/8B/swar-12 445742876 2.689 ns/op 0 B/op 0 allocs/op |
| 158 |
Benchmark_IndexAny3/8B/scalar-12 211981612 5.620 ns/op 0 B/op 0 allocs/op |
| 159 |
Benchmark_IndexAny3/16B/swar-12 326475568 3.739 ns/op 0 B/op 0 allocs/op |
| 160 |
Benchmark_IndexAny3/16B/scalar-12 100000000 10.31 ns/op 0 B/op 0 allocs/op |
| 161 |
Benchmark_IndexAny3/32B/swar-12 196365920 6.112 ns/op 0 B/op 0 allocs/op |
| 162 |
Benchmark_IndexAny3/32B/scalar-12 60021255 19.81 ns/op 0 B/op 0 allocs/op |
| 163 |
Benchmark_IndexAny3/64B/swar-12 100000000 10.98 ns/op 0 B/op 0 allocs/op |
| 164 |
Benchmark_IndexAny3/64B/scalar-12 31180405 38.97 ns/op 0 B/op 0 allocs/op |
| 165 |
Benchmark_IndexAny3/512B/swar-12 15466316 79.22 ns/op 0 B/op 0 allocs/op |
| 166 |
Benchmark_IndexAny3/512B/scalar-12 3911382 307.1 ns/op 0 B/op 0 allocs/op |
| 167 |
Benchmark_IndexFold/miss-8B/swar-12 332497509 3.634 ns/op 0 B/op 0 allocs/op |
| 168 |
Benchmark_IndexFold/miss-8B/scalar-12 491493494 2.408 ns/op 0 B/op 0 allocs/op |
| 169 |
Benchmark_IndexFold/miss-32B/swar-12 149769112 7.928 ns/op 0 B/op 0 allocs/op |
| 170 |
Benchmark_IndexFold/miss-32B/scalar-12 44041342 27.13 ns/op 0 B/op 0 allocs/op |
| 171 |
Benchmark_IndexFold/hit-32B/swar-12 138732252 8.758 ns/op 0 B/op 0 allocs/op |
| 172 |
Benchmark_IndexFold/hit-32B/scalar-12 33871633 30.73 ns/op 0 B/op 0 allocs/op |
| 173 |
Benchmark_IndexFold/hit-tail/swar-12 100000000 12.34 ns/op 0 B/op 0 allocs/op |
| 174 |
Benchmark_IndexFold/hit-tail/scalar-12 16138168 75.39 ns/op 0 B/op 0 allocs/op |
| 175 |
Benchmark_IndexFold/miss-64B/swar-12 100000000 11.37 ns/op 0 B/op 0 allocs/op |
| 176 |
Benchmark_IndexFold/miss-64B/scalar-12 17902330 67.78 ns/op 0 B/op 0 allocs/op |
| 177 |
Benchmark_IndexFold/miss-512B/swar-12 17640939 67.65 ns/op 0 B/op 0 allocs/op |
| 178 |
Benchmark_IndexFold/miss-512B/scalar-12 2211582 544.4 ns/op 0 B/op 0 allocs/op |
| 179 |
Benchmark_IndexFold/long-hit-64B/swar-12 100000000 11.58 ns/op 0 B/op 0 allocs/op |
| 180 |
Benchmark_IndexFold/long-hit-64B/scalar-12 23906326 51.33 ns/op 0 B/op 0 allocs/op |
| 181 |
Benchmark_IndexFold/long-miss-64B/swar-12 100000000 11.33 ns/op 0 B/op 0 allocs/op |
| 182 |
Benchmark_IndexFold/long-miss-64B/scalar-12 23553600 50.27 ns/op 0 B/op 0 allocs/op |
| 183 |
|
| 184 |
# ASCII |
| 185 |
// amd64 note: IsASCII dispatches to package simd for 32+ byte inputs; |
| 186 |
// these arm64 rows keep the portable SWAR path. See the simd section |
| 187 |
// below for amd64 numbers. |
| 188 |
Benchmark_IsASCII/7B/swar-12 238699563 5.001 ns/op 0 B/op 0 allocs/op |
| 189 |
Benchmark_IsASCII/7B/scalar-12 292669958 4.064 ns/op 0 B/op 0 allocs/op |
| 190 |
Benchmark_IsASCII/8B/swar-12 439961722 2.687 ns/op 0 B/op 0 allocs/op |
| 191 |
Benchmark_IsASCII/8B/scalar-12 274732192 4.364 ns/op 0 B/op 0 allocs/op |
| 192 |
Benchmark_IsASCII/16B/swar-12 367179319 3.255 ns/op 0 B/op 0 allocs/op |
| 193 |
Benchmark_IsASCII/16B/scalar-12 179331987 6.706 ns/op 0 B/op 0 allocs/op |
| 194 |
Benchmark_IsASCII/32B/swar-12 368345228 3.271 ns/op 0 B/op 0 allocs/op |
| 195 |
Benchmark_IsASCII/32B/scalar-12 100000000 11.62 ns/op 0 B/op 0 allocs/op |
| 196 |
Benchmark_IsASCII/64B/swar-12 265505815 4.486 ns/op 0 B/op 0 allocs/op |
| 197 |
Benchmark_IsASCII/64B/scalar-12 57864440 21.33 ns/op 0 B/op 0 allocs/op |
| 198 |
Benchmark_IsASCII/512B/swar-12 47664915 25.14 ns/op 0 B/op 0 allocs/op |
| 199 |
Benchmark_IsASCII/512B/scalar-12 7081790 169.5 ns/op 0 B/op 0 allocs/op |
| 200 |
Benchmark_IndexNonQuotable/7B/swar-12 142234436 8.424 ns/op 0 B/op 0 allocs/op |
| 201 |
Benchmark_IndexNonQuotable/7B/scalar-12 142394628 8.174 ns/op 0 B/op 0 allocs/op |
| 202 |
Benchmark_IndexNonQuotable/8B/swar-12 401721262 3.099 ns/op 0 B/op 0 allocs/op |
| 203 |
Benchmark_IndexNonQuotable/8B/scalar-12 138047568 8.654 ns/op 0 B/op 0 allocs/op |
| 204 |
Benchmark_IndexNonQuotable/16B/swar-12 244592613 5.059 ns/op 0 B/op 0 allocs/op |
| 205 |
Benchmark_IndexNonQuotable/16B/scalar-12 75413396 15.94 ns/op 0 B/op 0 allocs/op |
| 206 |
Benchmark_IndexNonQuotable/32B/swar-12 138857455 8.875 ns/op 0 B/op 0 allocs/op |
| 207 |
Benchmark_IndexNonQuotable/32B/scalar-12 39539425 30.18 ns/op 0 B/op 0 allocs/op |
| 208 |
Benchmark_IndexNonQuotable/64B/swar-12 75193269 16.46 ns/op 0 B/op 0 allocs/op |
| 209 |
Benchmark_IndexNonQuotable/64B/scalar-12 20898807 57.81 ns/op 0 B/op 0 allocs/op |
| 210 |
Benchmark_IndexNonQuotable/512B/swar-12 9634008 124.9 ns/op 0 B/op 0 allocs/op |
| 211 |
Benchmark_IndexNonQuotable/512B/scalar-12 2619062 460.6 ns/op 0 B/op 0 allocs/op |
| 212 |
|
| 213 |
# Trim |
| 214 |
Benchmark_TrimRight/fiber-12 587360972 2.043 ns/op 0 B/op 0 allocs/op |
| 215 |
Benchmark_TrimRight/default-12 417142952 2.887 ns/op 0 B/op 0 allocs/op |
| 216 |
Benchmark_TrimRightBytes/fiber-12 590828253 2.067 ns/op 0 B/op 0 allocs/op |
| 217 |
Benchmark_TrimRightBytes/default-12 374548395 3.236 ns/op 0 B/op 0 allocs/op |
| 218 |
Benchmark_TrimLeft/fiber-12 590822072 2.030 ns/op 0 B/op 0 allocs/op |
| 219 |
Benchmark_TrimLeft/default-12 408184784 2.967 ns/op 0 B/op 0 allocs/op |
| 220 |
Benchmark_TrimLeftBytes/fiber-12 592875732 2.033 ns/op 0 B/op 0 allocs/op |
| 221 |
Benchmark_TrimLeftBytes/default-12 405921434 2.967 ns/op 0 B/op 0 allocs/op |
| 222 |
Benchmark_Trim/fiber-12 317625432 3.758 ns/op 0 B/op 0 allocs/op |
| 223 |
Benchmark_Trim/default-12 250173384 4.735 ns/op 0 B/op 0 allocs/op |
| 224 |
Benchmark_Trim/default.trimspace-12 241883282 5.022 ns/op 0 B/op 0 allocs/op |
| 225 |
Benchmark_TrimBytes/fiber-12 308885211 3.858 ns/op 0 B/op 0 allocs/op |
| 226 |
Benchmark_TrimBytes/default-12 254064188 4.802 ns/op 0 B/op 0 allocs/op |
| 227 |
Benchmark_TrimBytes/default.trimspace-12 224231778 5.330 ns/op 0 B/op 0 allocs/op |
| 228 |
Benchmark_TrimSpace/fiber/empty-12 1000000000 0.3017 ns/op 0 B/op 0 allocs/op |
| 229 |
Benchmark_TrimSpace/default/empty-12 583064172 2.074 ns/op 0 B/op 0 allocs/op |
| 230 |
Benchmark_TrimSpace/fiber/spaces-12 387354229 3.059 ns/op 0 B/op 0 allocs/op |
| 231 |
Benchmark_TrimSpace/default/spaces-12 320059388 3.651 ns/op 0 B/op 0 allocs/op |
| 232 |
Benchmark_TrimSpace/fiber/ascii-word-12 345078337 3.535 ns/op 0 B/op 0 allocs/op |
| 233 |
Benchmark_TrimSpace/default/ascii-word-12 270603267 4.465 ns/op 0 B/op 0 allocs/op |
| 234 |
Benchmark_TrimSpace/fiber/auth-header-bearer-12 291494109 4.141 ns/op 0 B/op 0 allocs/op |
| 235 |
Benchmark_TrimSpace/default/auth-header-bearer-12 224087944 5.329 ns/op 0 B/op 0 allocs/op |
| 236 |
Benchmark_TrimSpace/fiber/auth-header-basic-12 390765345 3.047 ns/op 0 B/op 0 allocs/op |
| 237 |
Benchmark_TrimSpace/default/auth-header-basic-12 258943531 4.718 ns/op 0 B/op 0 allocs/op |
| 238 |
Benchmark_TrimSpace/fiber/accept-encoding-12 344369745 3.490 ns/op 0 B/op 0 allocs/op |
| 239 |
Benchmark_TrimSpace/default/accept-encoding-12 277203638 4.347 ns/op 0 B/op 0 allocs/op |
| 240 |
Benchmark_TrimSpace/fiber/content-type-12 344263705 3.506 ns/op 0 B/op 0 allocs/op |
| 241 |
Benchmark_TrimSpace/default/content-type-12 276213367 4.343 ns/op 0 B/op 0 allocs/op |
| 242 |
Benchmark_TrimSpace/fiber/x-forwarded-for-12 460119685 2.653 ns/op 0 B/op 0 allocs/op |
| 243 |
Benchmark_TrimSpace/default/x-forwarded-for-12 296468840 4.058 ns/op 0 B/op 0 allocs/op |
| 244 |
Benchmark_TrimSpace/fiber/query-params-12 330053276 3.520 ns/op 0 B/op 0 allocs/op |
| 245 |
Benchmark_TrimSpace/default/query-params-12 275688495 4.352 ns/op 0 B/op 0 allocs/op |
| 246 |
Benchmark_TrimSpace/fiber/ascii-long-12 275511898 4.342 ns/op 0 B/op 0 allocs/op |
| 247 |
Benchmark_TrimSpace/default/ascii-long-12 206143018 5.807 ns/op 0 B/op 0 allocs/op |
| 248 |
Benchmark_TrimSpace/fiber/no-trim-12 1000000000 0.5914 ns/op 0 B/op 0 allocs/op |
| 249 |
Benchmark_TrimSpace/default/no-trim-12 451842741 2.634 ns/op 0 B/op 0 allocs/op |
| 250 |
Benchmark_TrimSpace/fiber/mixed-whitespace-12 296083767 4.054 ns/op 0 B/op 0 allocs/op |
| 251 |
Benchmark_TrimSpace/default/mixed-whitespace-12 224007750 5.294 ns/op 0 B/op 0 allocs/op |
| 252 |
Benchmark_TrimSpaceBytes/fiber/empty-12 1000000000 0.2914 ns/op 0 B/op 0 allocs/op |
| 253 |
Benchmark_TrimSpaceBytes/default/empty-12 519488766 2.352 ns/op 0 B/op 0 allocs/op |
| 254 |
Benchmark_TrimSpaceBytes/fiber/spaces-12 410959255 2.966 ns/op 0 B/op 0 allocs/op |
| 255 |
Benchmark_TrimSpaceBytes/default/spaces-12 315602949 3.827 ns/op 0 B/op 0 allocs/op |
| 256 |
Benchmark_TrimSpaceBytes/fiber/ascii-word-12 341217429 3.519 ns/op 0 B/op 0 allocs/op |
| 257 |
Benchmark_TrimSpaceBytes/default/ascii-word-12 247799318 4.667 ns/op 0 B/op 0 allocs/op |
| 258 |
Benchmark_TrimSpaceBytes/fiber/auth-header-bearer-12 295130076 4.182 ns/op 0 B/op 0 allocs/op |
| 259 |
Benchmark_TrimSpaceBytes/default/auth-header-bearer-12 209162235 5.685 ns/op 0 B/op 0 allocs/op |
| 260 |
Benchmark_TrimSpaceBytes/fiber/auth-header-basic-12 393366796 3.053 ns/op 0 B/op 0 allocs/op |
| 261 |
Benchmark_TrimSpaceBytes/default/auth-header-basic-12 240882009 4.930 ns/op 0 B/op 0 allocs/op |
| 262 |
Benchmark_TrimSpaceBytes/fiber/accept-encoding-12 343673244 3.512 ns/op 0 B/op 0 allocs/op |
| 263 |
Benchmark_TrimSpaceBytes/default/accept-encoding-12 250962042 4.642 ns/op 0 B/op 0 allocs/op |
| 264 |
Benchmark_TrimSpaceBytes/fiber/content-type-12 344382758 3.516 ns/op 0 B/op 0 allocs/op |
| 265 |
Benchmark_TrimSpaceBytes/default/content-type-12 250622116 4.693 ns/op 0 B/op 0 allocs/op |
| 266 |
Benchmark_TrimSpaceBytes/fiber/x-forwarded-for-12 459435145 2.621 ns/op 0 B/op 0 allocs/op |
| 267 |
Benchmark_TrimSpaceBytes/default/x-forwarded-for-12 276595178 4.359 ns/op 0 B/op 0 allocs/op |
| 268 |
Benchmark_TrimSpaceBytes/fiber/query-params-12 341144192 3.526 ns/op 0 B/op 0 allocs/op |
| 269 |
Benchmark_TrimSpaceBytes/default/query-params-12 255843174 4.873 ns/op 0 B/op 0 allocs/op |
| 270 |
Benchmark_TrimSpaceBytes/fiber/ascii-long-12 270183530 4.445 ns/op 0 B/op 0 allocs/op |
| 271 |
Benchmark_TrimSpaceBytes/default/ascii-long-12 189740618 6.335 ns/op 0 B/op 0 allocs/op |
| 272 |
Benchmark_TrimSpaceBytes/fiber/no-trim-12 1000000000 0.5969 ns/op 0 B/op 0 allocs/op |
| 273 |
Benchmark_TrimSpaceBytes/default/no-trim-12 406072189 2.941 ns/op 0 B/op 0 allocs/op |
| 274 |
Benchmark_TrimSpaceBytes/fiber/mixed-whitespace-12 289382116 4.057 ns/op 0 B/op 0 allocs/op |
| 275 |
Benchmark_TrimSpaceBytes/default/mixed-whitespace-12 218559462 5.493 ns/op 0 B/op 0 allocs/op |
| 276 |
|
| 277 |
# Convert |
| 278 |
Benchmark_ConvertToBytes/fiber-12 320332576 3.787 ns/op 0 B/op 0 allocs/op |
| 279 |
Benchmark_ToString/int-12 499429904 2.382 ns/op 0 B/op 0 allocs/op |
| 280 |
Benchmark_ToString/int8-12 614406423 1.965 ns/op 0 B/op 0 allocs/op |
| 281 |
Benchmark_ToString/int16-12 486644316 2.463 ns/op 0 B/op 0 allocs/op |
| 282 |
Benchmark_ToString/int32-12 495227163 2.422 ns/op 0 B/op 0 allocs/op |
| 283 |
Benchmark_ToString/int64-12 502362236 2.429 ns/op 0 B/op 0 allocs/op |
| 284 |
Benchmark_ToString/uint-12 561693333 2.101 ns/op 0 B/op 0 allocs/op |
| 285 |
Benchmark_ToString/uint8-12 611239028 1.965 ns/op 0 B/op 0 allocs/op |
| 286 |
Benchmark_ToString/uint16-12 573383422 2.127 ns/op 0 B/op 0 allocs/op |
| 287 |
Benchmark_ToString/uint32-12 575723191 2.093 ns/op 0 B/op 0 allocs/op |
| 288 |
Benchmark_ToString/uint64-12 575901750 2.089 ns/op 0 B/op 0 allocs/op |
| 289 |
Benchmark_ToString/string-12 613909396 1.959 ns/op 0 B/op 0 allocs/op |
| 290 |
Benchmark_ToString/[]uint8-12 96832432 12.11 ns/op 16 B/op 1 allocs/op |
| 291 |
Benchmark_ToString/bool-12 608058547 1.990 ns/op 0 B/op 0 allocs/op |
| 292 |
Benchmark_ToString/float32-12 23195016 47.11 ns/op 4 B/op 1 allocs/op |
| 293 |
Benchmark_ToString/float64-12 17204126 70.24 ns/op 4 B/op 1 allocs/op |
| 294 |
Benchmark_ToString/time.Time-12 13103935 91.85 ns/op 24 B/op 1 allocs/op |
| 295 |
Benchmark_ToString/time.Time#01-12 13198113 91.22 ns/op 24 B/op 1 allocs/op |
| 296 |
Benchmark_ToString/[]string-12 65187865 18.35 ns/op 16 B/op 1 allocs/op |
| 297 |
Benchmark_ToString/[]int-12 54417859 21.53 ns/op 8 B/op 1 allocs/op |
| 298 |
Benchmark_ToString/[2]int-12 32691942 36.57 ns/op 16 B/op 1 allocs/op |
| 299 |
Benchmark_ToString/[][]int-12 9382754 128.8 ns/op 112 B/op 6 allocs/op |
| 300 |
Benchmark_ToString/[]interface_{}-12 10584483 114.5 ns/op 72 B/op 3 allocs/op |
| 301 |
Benchmark_ToString/utils.MyStringer-12 365979882 3.277 ns/op 0 B/op 0 allocs/op |
| 302 |
Benchmark_ToString/utils.CustomType-12 11649330 102.5 ns/op 16 B/op 1 allocs/op |
| 303 |
Benchmark_ToString_concurrency/int-12 1000000000 0.2619 ns/op 0 B/op 0 allocs/op |
| 304 |
Benchmark_ToString_concurrency/int8-12 1000000000 0.2202 ns/op 0 B/op 0 allocs/op |
| 305 |
Benchmark_ToString_concurrency/int16-12 1000000000 0.2708 ns/op 0 B/op 0 allocs/op |
| 306 |
Benchmark_ToString_concurrency/int32-12 1000000000 0.2658 ns/op 0 B/op 0 allocs/op |
| 307 |
Benchmark_ToString_concurrency/int64-12 1000000000 0.2658 ns/op 0 B/op 0 allocs/op |
| 308 |
Benchmark_ToString_concurrency/uint-12 1000000000 0.2281 ns/op 0 B/op 0 allocs/op |
| 309 |
Benchmark_ToString_concurrency/uint8-12 1000000000 0.2223 ns/op 0 B/op 0 allocs/op |
| 310 |
Benchmark_ToString_concurrency/uint16-12 1000000000 0.2396 ns/op 0 B/op 0 allocs/op |
| 311 |
Benchmark_ToString_concurrency/uint32-12 1000000000 0.2273 ns/op 0 B/op 0 allocs/op |
| 312 |
Benchmark_ToString_concurrency/uint64-12 1000000000 0.2271 ns/op 0 B/op 0 allocs/op |
| 313 |
Benchmark_ToString_concurrency/string-12 1000000000 0.2117 ns/op 0 B/op 0 allocs/op |
| 314 |
Benchmark_ToString_concurrency/[]uint8-12 213842515 5.718 ns/op 16 B/op 1 allocs/op |
| 315 |
Benchmark_ToString_concurrency/bool-12 1000000000 0.2118 ns/op 0 B/op 0 allocs/op |
| 316 |
Benchmark_ToString_concurrency/float32-12 201081819 6.011 ns/op 4 B/op 1 allocs/op |
| 317 |
Benchmark_ToString_concurrency/float64-12 142000966 8.799 ns/op 4 B/op 1 allocs/op |
| 318 |
Benchmark_ToString_concurrency/time.Time-12 71451783 18.04 ns/op 24 B/op 1 allocs/op |
| 319 |
Benchmark_ToString_concurrency/time.Time#01-12 69313578 17.74 ns/op 24 B/op 1 allocs/op |
| 320 |
Benchmark_ToString_concurrency/[]string-12 187564670 6.455 ns/op 16 B/op 1 allocs/op |
| 321 |
Benchmark_ToString_concurrency/[]int-12 262707805 4.498 ns/op 8 B/op 1 allocs/op |
| 322 |
Benchmark_ToString_concurrency/[2]int-12 129274200 8.777 ns/op 16 B/op 1 allocs/op |
| 323 |
Benchmark_ToString_concurrency/[][]int-12 22638411 52.65 ns/op 112 B/op 6 allocs/op |
| 324 |
Benchmark_ToString_concurrency/[]interface_{}-12 34120837 35.36 ns/op 72 B/op 3 allocs/op |
| 325 |
Benchmark_ToString_concurrency/utils.MyStringer-12 1000000000 0.4259 ns/op 0 B/op 0 allocs/op |
| 326 |
Benchmark_ToString_concurrency/utils.CustomType-12 54806094 25.95 ns/op 16 B/op 1 allocs/op |
| 327 |
Benchmark_UnsafeBytes/unsafe-12 1000000000 0.5658 ns/op 0 B/op 0 allocs/op |
| 328 |
Benchmark_UnsafeBytes/default-12 88407558 13.50 ns/op 16 B/op 1 allocs/op |
| 329 |
Benchmark_UnsafeString/unsafe-12 1000000000 0.3545 ns/op 0 B/op 0 allocs/op |
| 330 |
Benchmark_UnsafeString/default-12 100000000 12.09 ns/op 16 B/op 1 allocs/op |
| 331 |
Benchmark_ByteSize/0-12 395954607 3.023 ns/op 0 B/op 0 allocs/op |
| 332 |
Benchmark_ByteSize/1-12 65295756 18.15 ns/op 16 B/op 1 allocs/op |
| 333 |
Benchmark_ByteSize/500-12 58264801 20.92 ns/op 16 B/op 1 allocs/op |
| 334 |
Benchmark_ByteSize/1024-12 60886531 19.80 ns/op 16 B/op 1 allocs/op |
| 335 |
Benchmark_ByteSize/1126-12 53409986 22.69 ns/op 16 B/op 1 allocs/op |
| 336 |
Benchmark_ByteSize/1048576-12 60969927 19.41 ns/op 16 B/op 1 allocs/op |
| 337 |
Benchmark_ByteSize/1153024-12 53647869 22.12 ns/op 16 B/op 1 allocs/op |
| 338 |
Benchmark_ByteSize/1073741824-12 63792180 19.05 ns/op 16 B/op 1 allocs/op |
| 339 |
Benchmark_ByteSize/1180696576-12 54560540 22.02 ns/op 16 B/op 1 allocs/op |
| 340 |
Benchmark_ByteSize/1099511627776-12 64080169 18.85 ns/op 16 B/op 1 allocs/op |
| 341 |
Benchmark_ByteSize/1209033293824-12 52957434 22.01 ns/op 16 B/op 1 allocs/op |
| 342 |
Benchmark_ByteSize/1125899906842624-12 65629659 18.33 ns/op 16 B/op 1 allocs/op |
| 343 |
Benchmark_ByteSize/1238050092875776-12 56535770 21.73 ns/op 16 B/op 1 allocs/op |
| 344 |
Benchmark_ByteSize/1152921504606846976-12 64569356 18.56 ns/op 16 B/op 1 allocs/op |
| 345 |
Benchmark_ByteSize/1267763295104794624-12 56481996 21.10 ns/op 16 B/op 1 allocs/op |
| 346 |
|
| 347 |
# Format and Append |
| 348 |
Benchmark_FormatUint/small/fiber-12 607527520 1.966 ns/op 0 B/op 0 allocs/op |
| 349 |
Benchmark_FormatUint/small/strconv-12 607521366 1.973 ns/op 0 B/op 0 allocs/op |
| 350 |
Benchmark_FormatUint/medium/fiber-12 64427509 19.04 ns/op 16 B/op 1 allocs/op |
| 351 |
Benchmark_FormatUint/medium/strconv-12 59566404 20.42 ns/op 16 B/op 1 allocs/op |
| 352 |
Benchmark_FormatUint/large/fiber-12 45395149 26.16 ns/op 24 B/op 1 allocs/op |
| 353 |
Benchmark_FormatUint/large/strconv-12 45620366 26.38 ns/op 24 B/op 1 allocs/op |
| 354 |
Benchmark_FormatInt/small_pos/fiber-12 608898928 1.963 ns/op 0 B/op 0 allocs/op |
| 355 |
Benchmark_FormatInt/small_pos/strconv-12 598721480 1.976 ns/op 0 B/op 0 allocs/op |
| 356 |
Benchmark_FormatInt/small_neg/fiber-12 616958124 1.946 ns/op 0 B/op 0 allocs/op |
| 357 |
Benchmark_FormatInt/small_neg/strconv-12 87181050 13.77 ns/op 3 B/op 1 allocs/op |
| 358 |
Benchmark_FormatInt/medium_pos/fiber-12 63105722 19.12 ns/op 16 B/op 1 allocs/op |
| 359 |
Benchmark_FormatInt/medium_pos/strconv-12 57454753 20.70 ns/op 16 B/op 1 allocs/op |
| 360 |
Benchmark_FormatInt/medium_neg/fiber-12 63631222 19.10 ns/op 16 B/op 1 allocs/op |
| 361 |
Benchmark_FormatInt/medium_neg/strconv-12 61296942 20.17 ns/op 16 B/op 1 allocs/op |
| 362 |
Benchmark_FormatInt/large_pos/fiber-12 48604558 25.08 ns/op 24 B/op 1 allocs/op |
| 363 |
Benchmark_FormatInt/large_pos/strconv-12 45605844 26.25 ns/op 24 B/op 1 allocs/op |
| 364 |
Benchmark_FormatInt/large_neg/fiber-12 47388217 25.09 ns/op 24 B/op 1 allocs/op |
| 365 |
Benchmark_FormatInt/large_neg/strconv-12 45871998 26.10 ns/op 24 B/op 1 allocs/op |
| 366 |
Benchmark_FormatUint32/fiber-12 63452196 18.63 ns/op 16 B/op 1 allocs/op |
| 367 |
Benchmark_FormatUint32/strconv-12 59485942 20.08 ns/op 16 B/op 1 allocs/op |
| 368 |
Benchmark_FormatInt32/fiber-12 63030724 18.98 ns/op 16 B/op 1 allocs/op |
| 369 |
Benchmark_FormatInt32/strconv-12 61887302 19.69 ns/op 16 B/op 1 allocs/op |
| 370 |
Benchmark_FormatUint16/fiber-12 80149611 14.48 ns/op 5 B/op 1 allocs/op |
| 371 |
Benchmark_FormatUint16/strconv-12 77022440 15.43 ns/op 5 B/op 1 allocs/op |
| 372 |
Benchmark_FormatInt16/fiber-12 79013646 15.23 ns/op 8 B/op 1 allocs/op |
| 373 |
Benchmark_FormatInt16/strconv-12 79695165 15.24 ns/op 8 B/op 1 allocs/op |
| 374 |
Benchmark_FormatUint8/fiber-12 599811685 1.947 ns/op 0 B/op 0 allocs/op |
| 375 |
Benchmark_FormatUint8/strconv-12 84144096 14.18 ns/op 3 B/op 1 allocs/op |
| 376 |
Benchmark_FormatInt8/fiber-12 630717244 1.985 ns/op 0 B/op 0 allocs/op |
| 377 |
Benchmark_FormatInt8/strconv-12 83826201 14.24 ns/op 4 B/op 1 allocs/op |
| 378 |
Benchmark_AppendUint/fiber-12 130817422 9.139 ns/op 0 B/op 0 allocs/op |
| 379 |
Benchmark_AppendUint/strconv-12 100000000 10.08 ns/op 0 B/op 0 allocs/op |
| 380 |
Benchmark_AppendInt/small_neg/fiber-12 369512403 3.266 ns/op 0 B/op 0 allocs/op |
| 381 |
Benchmark_AppendInt/small_neg/strconv-12 213341739 5.627 ns/op 0 B/op 0 allocs/op |
| 382 |
Benchmark_AppendInt/medium_neg/fiber-12 125937435 9.531 ns/op 0 B/op 0 allocs/op |
| 383 |
Benchmark_AppendInt/medium_neg/strconv-12 122490632 9.791 ns/op 0 B/op 0 allocs/op |
| 384 |
|
| 385 |
# Token |
| 386 |
Benchmark_GenerateSecureToken/16_bytes-12 4565527 258.6 ns/op 24 B/op 1 allocs/op |
| 387 |
Benchmark_GenerateSecureToken/32_bytes-12 4306404 280.8 ns/op 48 B/op 1 allocs/op |
| 388 |
Benchmark_TokenGenerators/UUIDv4-12 4019139 288.2 ns/op 64 B/op 2 allocs/op |
| 389 |
Benchmark_TokenGenerators/SecureToken-12 4360036 276.9 ns/op 48 B/op 1 allocs/op |
| 390 |
|
| 391 |
# HTTP |
| 392 |
Benchmark_GetMIME/fiber-12 22321272 53.90 ns/op 0 B/op 0 allocs/op |
| 393 |
Benchmark_GetMIME/default-12 17492530 68.46 ns/op 0 B/op 0 allocs/op |
| 394 |
Benchmark_ParseVendorSpecificContentType/vendorContentType-12 125467813 9.619 ns/op 0 B/op 0 allocs/op |
| 395 |
Benchmark_ParseVendorSpecificContentType/defaultContentType-12 404169172 2.974 ns/op 0 B/op 0 allocs/op |
| 396 |
Benchmark_StatusMessage/fiber-12 1000000000 0.3349 ns/op 0 B/op 0 allocs/op |
| 397 |
Benchmark_StatusMessage/default-12 460456902 2.610 ns/op 0 B/op 0 allocs/op |
| 398 |
|
| 399 |
# IP |
| 400 |
Benchmark_IsIPv4/fiber-12 80408070 14.58 ns/op 0 B/op 0 allocs/op |
| 401 |
Benchmark_IsIPv4/default-12 54025154 21.99 ns/op 0 B/op 0 allocs/op |
| 402 |
Benchmark_IsIPv6/fiber-12 28283431 42.67 ns/op 0 B/op 0 allocs/op |
| 403 |
Benchmark_IsIPv6/default-12 20747964 58.18 ns/op 0 B/op 0 allocs/op |
| 404 |
|
| 405 |
# Parse |
| 406 |
Benchmark_ParseUint/fiber-12 236748204 5.049 ns/op 0 B/op 0 allocs/op |
| 407 |
Benchmark_ParseUint/fiber_bytes-12 224650773 5.348 ns/op 0 B/op 0 allocs/op |
| 408 |
Benchmark_ParseUint/default-12 88588122 13.75 ns/op 0 B/op 0 allocs/op |
| 409 |
Benchmark_ParseUint_DigitRuns/6digit-12 207540178 5.769 ns/op 0 B/op 0 allocs/op |
| 410 |
Benchmark_ParseUint_DigitRuns/8digit-12 222360716 5.403 ns/op 0 B/op 0 allocs/op |
| 411 |
Benchmark_ParseUint_DigitRuns/12digit-12 156132950 7.699 ns/op 0 B/op 0 allocs/op |
| 412 |
Benchmark_ParseUint_DigitRuns/19digit-12 135049720 8.880 ns/op 0 B/op 0 allocs/op |
| 413 |
Benchmark_ParseUint_DigitRuns/1digit-12 338642533 3.553 ns/op 0 B/op 0 allocs/op |
| 414 |
Benchmark_ParseUint_DigitRuns/4digit-12 212370570 5.672 ns/op 0 B/op 0 allocs/op |
| 415 |
Benchmark_ParseInt/fiber-12 299791800 3.981 ns/op 0 B/op 0 allocs/op |
| 416 |
Benchmark_ParseInt/fiber_bytes-12 288714712 4.165 ns/op 0 B/op 0 allocs/op |
| 417 |
Benchmark_ParseInt/default-12 76370292 15.48 ns/op 0 B/op 0 allocs/op |
| 418 |
Benchmark_ParseInt32/fiber-12 200451391 5.988 ns/op 0 B/op 0 allocs/op |
| 419 |
Benchmark_ParseInt32/fiber_bytes-12 201629558 5.956 ns/op 0 B/op 0 allocs/op |
| 420 |
Benchmark_ParseInt32/default-12 78384832 15.71 ns/op 0 B/op 0 allocs/op |
| 421 |
Benchmark_ParseInt16/fiber-12 220670613 5.462 ns/op 0 B/op 0 allocs/op |
| 422 |
Benchmark_ParseInt16/fiber_bytes-12 220175068 5.430 ns/op 0 B/op 0 allocs/op |
| 423 |
Benchmark_ParseInt16/default-12 100000000 10.71 ns/op 0 B/op 0 allocs/op |
| 424 |
Benchmark_ParseInt8/fiber-12 277948545 4.279 ns/op 0 B/op 0 allocs/op |
| 425 |
Benchmark_ParseInt8/fiber_bytes-12 264784368 4.566 ns/op 0 B/op 0 allocs/op |
| 426 |
Benchmark_ParseInt8/default-12 142184748 8.373 ns/op 0 B/op 0 allocs/op |
| 427 |
Benchmark_ParseUint32/fiber-12 238916116 5.025 ns/op 0 B/op 0 allocs/op |
| 428 |
Benchmark_ParseUint32/fiber_bytes-12 222286592 5.409 ns/op 0 B/op 0 allocs/op |
| 429 |
Benchmark_ParseUint32/default-12 90395479 13.33 ns/op 0 B/op 0 allocs/op |
| 430 |
Benchmark_ParseUint16/fiber-12 251398184 4.828 ns/op 0 B/op 0 allocs/op |
| 431 |
Benchmark_ParseUint16/fiber_bytes-12 248772012 4.838 ns/op 0 B/op 0 allocs/op |
| 432 |
Benchmark_ParseUint16/default-12 137015901 8.788 ns/op 0 B/op 0 allocs/op |
| 433 |
Benchmark_ParseUint8/fiber-12 360430984 3.427 ns/op 0 B/op 0 allocs/op |
| 434 |
Benchmark_ParseUint8/fiber_bytes-12 327526336 3.659 ns/op 0 B/op 0 allocs/op |
| 435 |
Benchmark_ParseUint8/default-12 181904056 6.438 ns/op 0 B/op 0 allocs/op |
| 436 |
Benchmark_ParseFloat64/fiber-12 82912768 14.76 ns/op 0 B/op 0 allocs/op |
| 437 |
Benchmark_ParseFloat64/fiber_bytes-12 95692504 12.68 ns/op 0 B/op 0 allocs/op |
| 438 |
Benchmark_ParseFloat64/default-12 50109265 25.05 ns/op 0 B/op 0 allocs/op |
| 439 |
Benchmark_ParseFloat32/fiber-12 76648135 15.76 ns/op 0 B/op 0 allocs/op |
| 440 |
Benchmark_ParseFloat32/fiber_bytes-12 86422119 13.63 ns/op 0 B/op 0 allocs/op |
| 441 |
Benchmark_ParseFloat32/default-12 47198646 25.41 ns/op 0 B/op 0 allocs/op |
| 442 |
|
| 443 |
# Time |
| 444 |
Benchmark_CalculateTimestamp/fiber-12 1000000000 0.3366 ns/op 0 B/op 0 allocs/op |
| 445 |
Benchmark_CalculateTimestamp/default-12 36163686 32.69 ns/op 0 B/op 0 allocs/op |
| 446 |
Benchmark_CalculateTimestamp/fiber_asserted-12 4471299 267.8 ns/op 12 B/op 2 allocs/op |
| 447 |
Benchmark_CalculateTimestamp/default_asserted-12 3991147 298.7 ns/op 8 B/op 2 allocs/op |
| 448 |
|
| 449 |
# XML |
| 450 |
Benchmark_GolangXMLEncoder-12 574852 2040 ns/op 4864 B/op 12 allocs/op |
| 451 |
Benchmark_DefaultXMLEncoder-12 593738 2012 ns/op 4864 B/op 12 allocs/op |
| 452 |
Benchmark_DefaultXMLDecoder-12 309031 3876 ns/op 2892 B/op 57 allocs/op |
| 453 |
``` |
| 454 |
|
| 455 |
See all the benchmarks under <https://gofiber.github.io/utils/benchmarks> |
| 456 |
|
| 457 |
## Case-insensitive matching helpers |
| 458 |
|
| 459 |
`EqualFold`, `IndexFold`, `ContainsFold`, `HasPrefixFold`, and |
| 460 |
`HasSuffixFold` compare ASCII case-insensitively using the SWAR word |
| 461 |
loops: only `A`..`Z`/`a`..`z` fold, every other byte (including bytes |
| 462 |
>= 0x80) must match exactly. `HasPrefixFold` and `HasSuffixFold` cover |
| 463 |
the header checks Fiber otherwise spells as an allocation-prone |
| 464 |
`ToLower` + `HasPrefix`/`HasSuffix` pair (authorization schemes such as |
| 465 |
`Bearer`, content-type prefixes such as `multipart/form-data`, suffixes |
| 466 |
such as `+json`), and like the other Fold helpers they take the needle |
| 467 |
as a plain string because call sites pass constant tokens. Their |
| 468 |
`Benchmark_HasPrefixFold`/`Benchmark_HasSuffixFold` numbers are tracked |
| 469 |
on the [benchmark charts](https://gofiber.github.io/utils/benchmarks/) |
| 470 |
and join the catalog above on its next regeneration. |
| 471 |
|
| 472 |
## HTTP dates |
| 473 |
|
| 474 |
`AppendHTTPDate` and `FormatHTTPDate` write a time in the RFC 9110 |
| 475 |
preferred HTTP date format (`Mon, 02 Jan 2006 15:04:05 GMT`, |
| 476 |
`net/http.TimeFormat`), byte-identical to `time.Format` with that layout |
| 477 |
but without walking a layout string: the calendar fields come from one |
| 478 |
civil-date conversion of `t.Unix()` (Hinnant's era arithmetic, instead of |
| 479 |
the three `abs()` walks behind `Date`, `Clock`, and `Weekday`), and are |
| 480 |
written into the fixed-width template with two-digit table lookups. |
| 481 |
`ParseHTTPDate` is the reverse: canonical preferred-format input takes a |
| 482 |
strict scalar fast path whose validated fields feed `time.Unix` directly |
| 483 |
— the same `Time` value `time.Date` builds, minus its normalization pass — |
| 484 |
and everything else — the obsolete RFC 850 and asctime forms, unusual |
| 485 |
casing, non-GMT zone names, padding — falls back to `time.Parse` with |
| 486 |
`net/http.ParseTime` semantics, including its errors. Both directions are |
| 487 |
pinned to the `time` package by a day-by-day sweep over the years |
| 488 |
0..9999. `Date`, `Last-Modified`, and `If-Modified-Since` handling sit on |
| 489 |
every request/response, which makes these the highest-leverage helpers in |
| 490 |
this group for Fiber. |
| 491 |
|
| 492 |
## URL escaping |
| 493 |
|
| 494 |
`AppendQueryEscape`/`AppendPathEscape` and |
| 495 |
`AppendQueryUnescape`/`AppendPathUnescape` produce byte-identical results |
| 496 |
(and, for the unescape pair, identical `url.EscapeError` values) to their |
| 497 |
`net/url` counterparts, as append-style, allocation-free single passes. |
| 498 |
The escape tables are pinned to `net/url.shouldEscape` by exhaustive |
| 499 |
per-byte tests. Unescaping jumps between escape sites with the vectorized |
| 500 |
scans (`IndexAny2` when `+` needs rewriting, `bytes.IndexByte` otherwise) |
| 501 |
and copies clean spans wholesale, so route parameters and query values |
| 502 |
without escapes — the common case — cost one scan and one copy. Decoding |
| 503 |
never grows the input, so `dst` may be `s[:0]` on a common backing array |
| 504 |
to unescape in place; escaping can grow the input, so there `dst` must |
| 505 |
not alias `s`. |
| 506 |
|
| 507 |
## JSON string escaping |
| 508 |
|
| 509 |
`AppendJSONString` appends a value as a double-quoted JSON string, |
| 510 |
byte-identical to `encoding/json.Marshal` of the same string — including |
| 511 |
its default HTML escaping (`<`, `>`, `&`), the `\ufffd` replacement of |
| 512 |
invalid UTF-8 bytes, and the U+2028/U+2029 escapes — without any of |
| 513 |
`Marshal`'s reflection or allocation. Clean spans are located with a SWAR |
| 514 |
scan (the same first-match-mask technique as `IndexNonQuotable`) and |
| 515 |
copied wholesale. This is the building block for hand-rolled JSON hot |
| 516 |
paths such as access-log lines and error bodies. |
| 517 |
|
| 518 |
## IP address parsing |
| 519 |
|
| 520 |
`ParseIPv4` and `ParseIPv6` parse addresses into `netip.Addr`, accepting |
| 521 |
exactly the strings `netip.ParseAddr` accepts for the respective family |
| 522 |
(pinned by fuzzing) while reporting failure with a `bool` instead of a |
| 523 |
constructed error. Both take strings or byte slices, so fasthttp-style |
| 524 |
callers skip the `string` conversion entirely; remote-address and |
| 525 |
trusted-proxy checks parse an IP on every request in Fiber. |
| 526 |
|
| 527 |
## Header key canonicalization |
| 528 |
|
| 529 |
`CanonicalHeaderKey` Title-Cases an HTTP header key exactly like |
| 530 |
`net/http.CanonicalHeaderKey`, including its return-unchanged guard for |
| 531 |
keys containing non-token bytes. Already-canonical keys — the common case |
| 532 |
on receive paths — are validated in a single table pass and returned |
| 533 |
as-is with zero allocations for strings and byte slices alike. Keys that |
| 534 |
do need rewriting cost one allocation; note that for the ~40 header names |
| 535 |
in the stdlib's interning table the stdlib returns a cached string |
| 536 |
without allocating, so this helper's edge there is time, not allocations. |
| 537 |
|
| 538 |
## Control-byte scanning |
| 539 |
|
| 540 |
`IndexControl` returns the index of the first ASCII control byte — a byte |
| 541 |
below 0x20 or DEL (0x7F), the RFC 5234 CTL set — and `IndexControlExceptTab` |
| 542 |
is the same scan with HTAB permitted, which is the byte set an RFC 9110 |
| 543 |
field value may not contain. Both are SWAR first-match scans |
| 544 |
(two words per branch, one overlapping word for the tail) over strings or |
| 545 |
byte slices; the HTAB exemption is tested only in words that hold a |
| 546 |
control byte, so clean input costs the same either way. They never match |
| 547 |
bytes >= 0x80, so unlike |
| 548 |
`strings.IndexFunc(s, unicode.IsControl)` they neither decode UTF-8 nor |
| 549 |
flag the C1 range hidden inside it. Fiber spells this check by hand in |
| 550 |
half a dozen places — header values before they are echoed, request IDs, |
| 551 |
`Location` values, log fields, Basic auth credentials — and each copy is |
| 552 |
one of these two calls. |
| 553 |
|
| 554 |
## Byte-separator cuts |
| 555 |
|
| 556 |
`CutByte` and `LastCutByte` are `strings.Cut`/`bytes.Cut` for a single |
| 557 |
byte separator, around its first or last occurrence, generic over strings |
| 558 |
and byte slices. They return the two parts and a found flag exactly like |
| 559 |
the stdlib pair (including the `""`/`nil` after-part of a miss), cost one |
| 560 |
`IndexByte`/`LastIndexByte`, and spare `[]byte` callers the `[]byte{sep}` |
| 561 |
needle and the length dispatch inside `bytes.Index`. `CutByte` beats |
| 562 |
`strings.Cut`; `LastCutByte` has no stdlib counterpart, so its row is |
| 563 |
measured against a hand-written `LastIndexByte` split, which it trails by |
| 564 |
the cost of the call — its value is the generic `[]byte` support and the |
| 565 |
readable spelling. Header parameter splits (`;`), `key=value` pairs, and |
| 566 |
host/port and name/extension splits are the intended call sites. |
| 567 |
|
| 568 |
## Host and port splitting |
| 569 |
|
| 570 |
`SplitHostPort` splits `host:port`, `host%zone:port`, `[host]:port`, and |
| 571 |
`[host%zone]:port` with exactly `net.SplitHostPort`'s acceptance rules |
| 572 |
(pinned by fuzzing against it), but reports failure with a `bool` instead |
| 573 |
of constructing a `*net.AddrError`, and accepts byte slices. Valid input |
| 574 |
costs the same as the stdlib — the scan is the same three `IndexByte` |
| 575 |
calls — so the win is on the rejection path, where a malformed `Host` or |
| 576 |
`Forwarded` value no longer costs an allocation, and on `[]byte` input, |
| 577 |
which no longer needs a string conversion first. |
| 578 |
|
| 579 |
## List field iteration |
| 580 |
|
| 581 |
`SplitTrimSeq` returns an iterator over the elements of a list separated |
| 582 |
by one byte, with ASCII whitespace trimmed from each element and empty |
| 583 |
elements skipped — how HTTP list fields such as `Accept-Encoding`, |
| 584 |
`Connection`, `Vary`, and `Cache-Control` are read (RFC 9110 Section |
| 585 |
5.6.1: optional whitespace around the commas, empty elements ignored). |
| 586 |
It replaces the `strings.SplitSeq` + `TrimSpace` + emptiness-check |
| 587 |
triplet, locates each separator with a single `IndexByte`, works on |
| 588 |
strings and byte slices alike, and yields subslices without copying. In |
| 589 |
an ordinary caller the iterator inlines and allocates nothing, like |
| 590 |
`strings.SplitSeq`; the benchmark ranges inside a helper function for |
| 591 |
that reason, because calls made directly inside a `b.Loop` body are |
| 592 |
never inlined and would show the closure allocations instead. |
| 593 |
|
| 594 |
## Duration formatting |
| 595 |
|
| 596 |
`AppendDuration` renders a `time.Duration` exactly as `d.String()` does — |
| 597 |
"72h3m0.5s", "1.5ms", "0s" — into the caller's buffer, with the two-digit |
| 598 |
table for the field digits; a value with no fraction, the common case, |
| 599 |
never touches the fraction digits. `d.String()` allocates its result and |
| 600 |
`fmt.Fprintf("%v", d)`, which Fiber's logger uses for the latency column, |
| 601 |
costs several times more on top; an append-style form makes per-request |
| 602 |
duration rendering (access logs, `Server-Timing`) allocation-free. |
| 603 |
|
| 604 |
## Decimal formatting |
| 605 |
|
| 606 |
`FormatUint`/`FormatInt` (and their 32- and 16-bit variants) and |
| 607 |
`AppendUint`/`AppendInt` render integers eight digits at a time: a value |
| 608 |
below 1e8 becomes eight zero-padded digit lanes through a fixed sequence |
| 609 |
of multiplies, shifts, and masks (the SWAR inverse of the 8-digit parse |
| 610 |
step in `ParseInt`), so a 64-bit value costs at most three such |
| 611 |
conversions and two divisions, all independent of each other, instead of |
| 612 |
one dependent divide-and-store per digit; the first significant digit is |
| 613 |
found with a trailing-zero count. Values below 100 come from a |
| 614 |
precomputed table, and the output is pinned to `strconv` by a dense sweep |
| 615 |
plus every decimal and lane-group boundary. `GetMIME` in the same spirit |
| 616 |
looks up extensions through a hash table keyed by the extension packed |
| 617 |
into one lower-cased word with its length in the top lane, so a hit is a |
| 618 |
multiply, a shift, and one slot comparison, with no allocation even for |
| 619 |
upper-case input. |
| 620 |
|
| 621 |
These helpers were added on an amd64 machine, so like the `simd` numbers |
| 622 |
their benchmarks are recorded separately from the arm64 catalog above and |
| 623 |
join it on its next regeneration. The block also carries the current |
| 624 |
numbers for the paths reworked on the same machine (integer formatting, |
| 625 |
`GetMIME`, token-sized `EqualFold`), whose arm64 rows above predate that |
| 626 |
work: |
| 627 |
|
| 628 |
Environment: |
| 629 |
goos: linux |
| 630 |
goarch: amd64 |
| 631 |
pkg: github.com/gofiber/utils/v2 |
| 632 |
cpu: Intel(R) Xeon(R) Processor @ 2.80GHz |
| 633 |
|
| 634 |
```text |
| 635 |
// go test -benchmem -run=^$ -count=1 . -bench='^Benchmark_(FormatUint|FormatInt|FormatUint32|FormatInt32|FormatUint16|FormatInt16|AppendUint|AppendInt|EqualFold_Short|GetMIME|AppendHTTPDate|ParseHTTPDate|AppendDuration|AppendQueryEscape|AppendQueryUnescape|AppendPathUnescape|AppendJSONString|ParseIPv4|ParseIPv6|CanonicalHeaderKey|IndexControl|CutByte|LastCutByte|SplitHostPort|SplitTrimSeq)$' |
| 636 |
Benchmark_EqualFold_Short/3B/fiber-4 229602248 5.312 ns/op 0 B/op 0 allocs/op |
| 637 |
Benchmark_EqualFold_Short/3B/default-4 204528979 5.852 ns/op 0 B/op 0 allocs/op |
| 638 |
Benchmark_EqualFold_Short/4B/fiber-4 229813917 5.255 ns/op 0 B/op 0 allocs/op |
| 639 |
Benchmark_EqualFold_Short/4B/default-4 156456847 7.464 ns/op 0 B/op 0 allocs/op |
| 640 |
Benchmark_EqualFold_Short/5B/fiber-4 229097964 5.234 ns/op 0 B/op 0 allocs/op |
| 641 |
Benchmark_EqualFold_Short/5B/default-4 197214793 6.189 ns/op 0 B/op 0 allocs/op |
| 642 |
Benchmark_EqualFold_Short/7B/fiber-4 232463892 5.179 ns/op 0 B/op 0 allocs/op |
| 643 |
Benchmark_EqualFold_Short/7B/default-4 160397131 7.450 ns/op 0 B/op 0 allocs/op |
| 644 |
Benchmark_EqualFold_Short/8B/fiber-4 216077086 5.531 ns/op 0 B/op 0 allocs/op |
| 645 |
Benchmark_EqualFold_Short/8B/default-4 159104245 7.543 ns/op 0 B/op 0 allocs/op |
| 646 |
Benchmark_EqualFold_Short/10B/fiber-4 144306822 8.317 ns/op 0 B/op 0 allocs/op |
| 647 |
Benchmark_EqualFold_Short/10B/default-4 120878482 9.925 ns/op 0 B/op 0 allocs/op |
| 648 |
Benchmark_EqualFold_Short/16B/fiber-4 143038372 8.357 ns/op 0 B/op 0 allocs/op |
| 649 |
Benchmark_EqualFold_Short/16B/default-4 85405070 14.49 ns/op 0 B/op 0 allocs/op |
| 650 |
Benchmark_IndexControl/clean-16B/fiber-4 169144147 7.146 ns/op 0 B/op 0 allocs/op |
| 651 |
Benchmark_IndexControl/clean-16B/fiber-except-tab-4 167529128 7.135 ns/op 0 B/op 0 allocs/op |
| 652 |
Benchmark_IndexControl/clean-16B/default-4 32870788 36.35 ns/op 0 B/op 0 allocs/op |
| 653 |
Benchmark_IndexControl/clean-64B/fiber-4 75379568 16.27 ns/op 0 B/op 0 allocs/op |
| 654 |
Benchmark_IndexControl/clean-64B/fiber-except-tab-4 73955293 16.14 ns/op 0 B/op 0 allocs/op |
| 655 |
Benchmark_IndexControl/clean-64B/default-4 8875356 135.6 ns/op 0 B/op 0 allocs/op |
| 656 |
Benchmark_IndexControl/ctl-at-end-64B/fiber-4 72450939 16.83 ns/op 0 B/op 0 allocs/op |
| 657 |
Benchmark_IndexControl/ctl-at-end-64B/fiber-except-tab-4 71671362 16.68 ns/op 0 B/op 0 allocs/op |
| 658 |
Benchmark_IndexControl/ctl-at-end-64B/default-4 8478050 141.1 ns/op 0 B/op 0 allocs/op |
| 659 |
Benchmark_CutByte/fiber-4 180741241 6.688 ns/op 0 B/op 0 allocs/op |
| 660 |
Benchmark_CutByte/default-4 100000000 10.28 ns/op 0 B/op 0 allocs/op |
| 661 |
Benchmark_CutByte/fiber-bytes-4 168499478 7.147 ns/op 0 B/op 0 allocs/op |
| 662 |
Benchmark_CutByte/default-bytes-4 141645026 8.407 ns/op 0 B/op 0 allocs/op |
| 663 |
Benchmark_LastCutByte/fiber-4 190695121 6.336 ns/op 0 B/op 0 allocs/op |
| 664 |
Benchmark_LastCutByte/default-4 201893814 5.937 ns/op 0 B/op 0 allocs/op |
| 665 |
Benchmark_AppendDuration/micros/fiber-4 94853876 12.96 ns/op 0 B/op 0 allocs/op |
| 666 |
Benchmark_AppendDuration/micros/default-4 37404410 30.76 ns/op 8 B/op 1 allocs/op |
| 667 |
Benchmark_AppendDuration/micros/fmt-4 9448436 127.8 ns/op 16 B/op 2 allocs/op |
| 668 |
Benchmark_AppendDuration/millis-frac/fiber-4 57206034 20.25 ns/op 0 B/op 0 allocs/op |
| 669 |
Benchmark_AppendDuration/millis-frac/default-4 28241080 39.08 ns/op 16 B/op 1 allocs/op |
| 670 |
Benchmark_AppendDuration/millis-frac/fmt-4 8029897 144.3 ns/op 24 B/op 2 allocs/op |
| 671 |
Benchmark_AppendDuration/hours/fiber-4 77311298 15.06 ns/op 0 B/op 0 allocs/op |
| 672 |
Benchmark_AppendDuration/hours/default-4 26855806 42.60 ns/op 8 B/op 1 allocs/op |
| 673 |
Benchmark_AppendDuration/hours/fmt-4 8546384 146.6 ns/op 16 B/op 2 allocs/op |
| 674 |
Benchmark_FormatUint/small/fiber-4 629069014 1.888 ns/op 0 B/op 0 allocs/op |
| 675 |
Benchmark_FormatUint/small/strconv-4 505295925 2.371 ns/op 0 B/op 0 allocs/op |
| 676 |
Benchmark_FormatUint/medium/fiber-4 40310542 28.33 ns/op 16 B/op 1 allocs/op |
| 677 |
Benchmark_FormatUint/medium/strconv-4 36065356 33.07 ns/op 16 B/op 1 allocs/op |
| 678 |
Benchmark_FormatUint/large/fiber-4 36428881 33.66 ns/op 24 B/op 1 allocs/op |
| 679 |
Benchmark_FormatUint/large/strconv-4 24582408 49.04 ns/op 24 B/op 1 allocs/op |
| 680 |
Benchmark_FormatInt/small_pos/fiber-4 568438807 2.074 ns/op 0 B/op 0 allocs/op |
| 681 |
Benchmark_FormatInt/small_pos/strconv-4 509641584 2.378 ns/op 0 B/op 0 allocs/op |
| 682 |
Benchmark_FormatInt/small_neg/fiber-4 552536096 2.169 ns/op 0 B/op 0 allocs/op |
| 683 |
Benchmark_FormatInt/small_neg/strconv-4 67741922 18.14 ns/op 3 B/op 1 allocs/op |
| 684 |
Benchmark_FormatInt/medium_pos/fiber-4 36409581 28.36 ns/op 16 B/op 1 allocs/op |
| 685 |
Benchmark_FormatInt/medium_pos/strconv-4 34719836 34.57 ns/op 16 B/op 1 allocs/op |
| 686 |
Benchmark_FormatInt/medium_neg/fiber-4 43244299 27.74 ns/op 16 B/op 1 allocs/op |
| 687 |
Benchmark_FormatInt/medium_neg/strconv-4 36308307 33.28 ns/op 16 B/op 1 allocs/op |
| 688 |
Benchmark_FormatInt/large_pos/fiber-4 34108224 34.78 ns/op 24 B/op 1 allocs/op |
| 689 |
Benchmark_FormatInt/large_pos/strconv-4 23271465 49.00 ns/op 24 B/op 1 allocs/op |
| 690 |
Benchmark_FormatInt/large_neg/fiber-4 35237299 34.85 ns/op 24 B/op 1 allocs/op |
| 691 |
Benchmark_FormatInt/large_neg/strconv-4 24433351 47.63 ns/op 24 B/op 1 allocs/op |
| 692 |
Benchmark_FormatUint32/fiber-4 46063810 26.37 ns/op 16 B/op 1 allocs/op |
| 693 |
Benchmark_FormatUint32/strconv-4 34846262 33.88 ns/op 16 B/op 1 allocs/op |
| 694 |
Benchmark_FormatInt32/fiber-4 42975921 27.59 ns/op 16 B/op 1 allocs/op |
| 695 |
Benchmark_FormatInt32/strconv-4 36954268 33.17 ns/op 16 B/op 1 allocs/op |
| 696 |
Benchmark_FormatUint16/fiber-4 60632233 19.36 ns/op 5 B/op 1 allocs/op |
| 697 |
Benchmark_FormatUint16/strconv-4 51189382 22.75 ns/op 5 B/op 1 allocs/op |
| 698 |
Benchmark_FormatInt16/fiber-4 55760065 20.90 ns/op 8 B/op 1 allocs/op |
| 699 |
Benchmark_FormatInt16/strconv-4 48868172 24.20 ns/op 8 B/op 1 allocs/op |
| 700 |
Benchmark_AppendUint/fiber-4 91578640 12.35 ns/op 0 B/op 0 allocs/op |
| 701 |
Benchmark_AppendUint/strconv-4 72172658 17.55 ns/op 0 B/op 0 allocs/op |
| 702 |
Benchmark_AppendInt/small_neg/fiber-4 314797556 3.782 ns/op 0 B/op 0 allocs/op |
| 703 |
Benchmark_AppendInt/small_neg/strconv-4 100000000 10.91 ns/op 0 B/op 0 allocs/op |
| 704 |
Benchmark_AppendInt/medium_neg/fiber-4 91859277 13.20 ns/op 0 B/op 0 allocs/op |
| 705 |
Benchmark_AppendInt/medium_neg/strconv-4 70492820 17.12 ns/op 0 B/op 0 allocs/op |
| 706 |
Benchmark_CanonicalHeaderKey/canonical/fiber-4 66962880 17.98 ns/op 0 B/op 0 allocs/op |
| 707 |
Benchmark_CanonicalHeaderKey/canonical/default-4 46076755 26.65 ns/op 0 B/op 0 allocs/op |
| 708 |
Benchmark_CanonicalHeaderKey/common-lower/fiber-4 28066642 44.43 ns/op 16 B/op 1 allocs/op |
| 709 |
Benchmark_CanonicalHeaderKey/common-lower/default-4 23367423 50.83 ns/op 0 B/op 0 allocs/op |
| 710 |
Benchmark_CanonicalHeaderKey/custom-lower/fiber-4 20437851 58.07 ns/op 24 B/op 1 allocs/op |
| 711 |
Benchmark_CanonicalHeaderKey/custom-lower/default-4 13395525 87.34 ns/op 24 B/op 1 allocs/op |
| 712 |
Benchmark_SplitHostPort/host-port/fiber-4 66885448 17.17 ns/op 0 B/op 0 allocs/op |
| 713 |
Benchmark_SplitHostPort/host-port/default-4 73398602 16.60 ns/op 0 B/op 0 allocs/op |
| 714 |
Benchmark_SplitHostPort/ipv6-port/fiber-4 69142788 17.70 ns/op 0 B/op 0 allocs/op |
| 715 |
Benchmark_SplitHostPort/ipv6-port/default-4 68252304 17.28 ns/op 0 B/op 0 allocs/op |
| 716 |
Benchmark_SplitHostPort/missing-port/fiber-4 167778152 7.224 ns/op 0 B/op 0 allocs/op |
| 717 |
Benchmark_SplitHostPort/missing-port/default-4 30424182 38.16 ns/op 32 B/op 1 allocs/op |
| 718 |
Benchmark_GetMIME/fiber-4 39471765 29.38 ns/op 0 B/op 0 allocs/op |
| 719 |
Benchmark_GetMIME/default-4 10284040 112.3 ns/op 0 B/op 0 allocs/op |
| 720 |
Benchmark_AppendHTTPDate/fiber-4 47681026 25.21 ns/op 0 B/op 0 allocs/op |
| 721 |
Benchmark_AppendHTTPDate/default-4 8757169 134.9 ns/op 0 B/op 0 allocs/op |
| 722 |
Benchmark_ParseHTTPDate/fiber-4 58871844 18.57 ns/op 0 B/op 0 allocs/op |
| 723 |
Benchmark_ParseHTTPDate/default-4 6421057 187.1 ns/op 0 B/op 0 allocs/op |
| 724 |
Benchmark_ParseIPv4/fiber-4 66056898 18.34 ns/op 0 B/op 0 allocs/op |
| 725 |
Benchmark_ParseIPv4/default-4 44932904 26.84 ns/op 0 B/op 0 allocs/op |
| 726 |
Benchmark_ParseIPv6/compressed/fiber-4 25820896 46.48 ns/op 0 B/op 0 allocs/op |
| 727 |
Benchmark_ParseIPv6/compressed/default-4 17371059 65.48 ns/op 0 B/op 0 allocs/op |
| 728 |
Benchmark_ParseIPv6/full/fiber-4 20636487 60.00 ns/op 0 B/op 0 allocs/op |
| 729 |
Benchmark_ParseIPv6/full/default-4 12097987 84.13 ns/op 0 B/op 0 allocs/op |
| 730 |
Benchmark_AppendJSONString/clean-16B/fiber-4 57606924 21.13 ns/op 0 B/op 0 allocs/op |
| 731 |
Benchmark_AppendJSONString/clean-16B/default-4 8575510 143.9 ns/op 40 B/op 2 allocs/op |
| 732 |
Benchmark_AppendJSONString/clean-64B/fiber-4 20014062 60.74 ns/op 0 B/op 0 allocs/op |
| 733 |
Benchmark_AppendJSONString/clean-64B/default-4 5525064 222.1 ns/op 96 B/op 2 allocs/op |
| 734 |
Benchmark_AppendJSONString/escaped-64B/fiber-4 7843610 149.5 ns/op 0 B/op 0 allocs/op |
| 735 |
Benchmark_AppendJSONString/escaped-64B/default-4 4009515 291.9 ns/op 96 B/op 2 allocs/op |
| 736 |
Benchmark_AppendJSONString/unicode-64B/fiber-4 4916204 239.6 ns/op 0 B/op 0 allocs/op |
| 737 |
Benchmark_AppendJSONString/unicode-64B/default-4 3485493 347.0 ns/op 112 B/op 2 allocs/op |
| 738 |
Benchmark_SplitTrimSeq/accept-encoding/fiber-4 54431074 21.50 ns/op 0 B/op 0 allocs/op |
| 739 |
Benchmark_SplitTrimSeq/accept-encoding/default-4 50593407 24.16 ns/op 0 B/op 0 allocs/op |
| 740 |
Benchmark_SplitTrimSeq/accept/fiber-4 19936736 59.24 ns/op 0 B/op 0 allocs/op |
| 741 |
Benchmark_SplitTrimSeq/accept/default-4 18168722 65.87 ns/op 0 B/op 0 allocs/op |
| 742 |
Benchmark_AppendQueryEscape/clean-64B/fiber-4 25016198 49.70 ns/op 0 B/op 0 allocs/op |
| 743 |
Benchmark_AppendQueryEscape/clean-64B/default-4 6857455 176.6 ns/op 0 B/op 0 allocs/op |
| 744 |
Benchmark_AppendQueryEscape/mixed-64B/fiber-4 5858684 213.5 ns/op 0 B/op 0 allocs/op |
| 745 |
Benchmark_AppendQueryEscape/mixed-64B/default-4 1989934 600.0 ns/op 192 B/op 2 allocs/op |
| 746 |
Benchmark_AppendQueryUnescape/plain-64B/fiber-4 76538192 15.30 ns/op 0 B/op 0 allocs/op |
| 747 |
Benchmark_AppendQueryUnescape/plain-64B/default-4 10383134 116.5 ns/op 0 B/op 0 allocs/op |
| 748 |
Benchmark_AppendQueryUnescape/escaped-64B/fiber-4 4906606 218.5 ns/op 0 B/op 0 allocs/op |
| 749 |
Benchmark_AppendQueryUnescape/escaped-64B/default-4 4306238 274.6 ns/op 48 B/op 1 allocs/op |
| 750 |
Benchmark_AppendPathUnescape/plain-25B/fiber-4 100000000 12.00 ns/op 0 B/op 0 allocs/op |
| 751 |
Benchmark_AppendPathUnescape/plain-25B/default-4 24661267 45.81 ns/op 0 B/op 0 allocs/op |
| 752 |
Benchmark_AppendPathUnescape/escaped-31B/fiber-4 20543667 58.60 ns/op 0 B/op 0 allocs/op |
| 753 |
Benchmark_AppendPathUnescape/escaped-31B/default-4 8119328 147.5 ns/op 24 B/op 1 allocs/op |
| 754 |
``` |
| 755 |
|
| 756 |
## SWAR primitives |
| 757 |
|
| 758 |
The [`swar`](swar/) package exports the SWAR (SIMD within a register) |
| 759 |
building blocks the helpers above are composed from: `Load8`/`Store8`, |
| 760 |
`Broadcast`, `ZeroLanes`, `MatchByteMask`/`MatchRangeMask`, |
| 761 |
`ToLowerWord`/`ToUpperWord`, `FirstLane`/`LastLane`, and the `WordLen`, |
| 762 |
`Ones`, `HighBits`, and `LowSeven` constants. They are exported so |
| 763 |
downstream packages (Fiber itself, middleware) can fuse their own byte |
| 764 |
scans — for example, finding a delimiter while classifying the bytes |
| 765 |
before it — without re-deriving the bit tricks. The contracts (unchecked |
| 766 |
bounds preconditions, `ZeroLanes`' approximate mask, the little-endian |
| 767 |
lane order) and runnable examples live in the package documentation. |
| 768 |
|
| 769 |
The package benchmarks its primitives against their stdlib counterparts |
| 770 |
the same way the helpers above do, measuring the canonical loops composed |
| 771 |
from them: `Load8`/`Store8` vs `encoding/binary`'s little-endian |
| 772 |
`Uint64`/`PutUint64`, a `ZeroLanes` first-match scan vs |
| 773 |
`strings.IndexByte`, a `MatchByteMask`+`LastLane` reverse scan vs |
| 774 |
`bytes.LastIndexByte`, a `MatchRangeMask` digit scan vs |
| 775 |
`strings.IndexAny`, and an in-place `ToLowerWord` loop vs |
| 776 |
`bytes.ToLower`. The composed loops are pinned to the stdlib results by a |
| 777 |
dedicated test, and the numbers are tracked per commit on the |
| 778 |
[benchmark charts](https://gofiber.github.io/utils/benchmarks/). Note |
| 779 |
that `strings.IndexByte` is hand-written SIMD assembly and overtakes the |
| 780 |
portable SWAR scan on large inputs; the SWAR primitives earn their keep |
| 781 |
on short HTTP-sized inputs and on fused scans the stdlib has no single |
| 782 |
function for. The package's remaining benchmark, `Benchmark_Load8_Fusion`, |
| 783 |
is an advisory codegen guard rather than an API performance promise, so |
| 784 |
it is deliberately not part of the catalog above. |
| 785 |
|
| 786 |
## SIMD-accelerated search (package simd) |
| 787 |
|
| 788 |
The [`simd`](simd/) package is the vector-width counterpart to `swar`: byte |
| 789 |
searching and validation whose scan kernels dispatch to AVX2 assembly (four |
| 790 |
32-byte vectors per iteration) on amd64 CPUs for inputs of `simd.MinLen` |
| 791 |
(32) bytes or more, and fall back to portable loops built on the `swar` |
| 792 |
primitives everywhere else, so it builds and behaves identically on every |
| 793 |
platform. |
| 794 |
`simd.Accelerated()` reports which mode is active. CPU capability detection |
| 795 |
uses [`golang.org/x/sys/cpu`](https://pkg.go.dev/golang.org/x/sys/cpu), |
| 796 |
which also verifies OS support for saving the vector register state. |
| 797 |
|
| 798 |
The AVX2-backed kernels are the multi-needle scans (`Memchr2`, `Memchr3`), |
| 799 |
the paired-byte scan (`MemchrPair`), the class scans |
| 800 |
(`MemchrDigit`/`MemchrDigitAt`, `MemchrWord`/`MemchrNotWord`), the ASCII |
| 801 |
scans (`IsASCII`, `FirstNonASCII`, `CountNonASCII`), and the substring |
| 802 |
search (`Memmem`), which |
| 803 |
prefilters on the needle's rarest bytes (`SelectRareBytes`, `ByteRank`) |
| 804 |
before verifying candidates — 2-6 byte needles containing two distinct |
| 805 |
values are scanned for their two rarest bytes at the exact relative |
| 806 |
distance, longer or single-valued needles for the single rarest byte. |
| 807 |
Each kernel classifies four 32-byte vectors per iteration. Where the |
| 808 |
result is a position or a yes/no, the four masks are combined, so a |
| 809 |
128-byte block costs a single `VPMOVMSKB` and a single branch, and the |
| 810 |
scans that report a position re-extract the four masks in address order on |
| 811 |
the (rare) hit path. `CountNonASCII` is the exception — a count cannot be |
| 812 |
recovered from a combined mask, so its block loop accumulates per-lane |
| 813 |
counts in vector byte lanes (a signed compare against zero and a byte |
| 814 |
subtract per vector) and reduces them once at the end, while the |
| 815 |
remaining whole vectors are extracted and population-counted; it is the |
| 816 |
one kernel gated on `POPCNT` in addition to AVX2. |
| 817 |
One tier is documented explicitly as unaccelerated: |
| 818 |
`MemchrInTable`/`MemchrNotInTable` are plain |
| 819 |
scalar loops, since an arbitrary 256-entry membership test has no cheap |
| 820 |
vector form. There is deliberately no single-needle `Memchr`: |
| 821 |
`bytes.IndexByte` is already vector-accelerated by the Go runtime. `Memmem` |
| 822 |
delegates to `bytes.Index` for haystacks of up to 64 bytes, where the |
| 823 |
stdlib's brute-force vector kernel is level with the paired prefilter |
| 824 |
(`Benchmark_Memmem_Prefilter` forces the prefilter helpers at every size |
| 825 |
to keep that measurable); from 65 bytes `bytes.Index` switches to a loop |
| 826 |
anchored on the needle's first byte, and the paired scan takes over. |
| 827 |
Needles that take the single rare-byte scan keep a 128-byte routing point, |
| 828 |
since that scan is less selective. Both prefilters bail to `bytes.Index` |
| 829 |
after a bounded number of failed candidate verifications, so even |
| 830 |
adversarial inputs — a rare byte everywhere plus a long almost-matching |
| 831 |
needle — stay within a constant of the stdlib's O(n+m) (see |
| 832 |
`Benchmark_Memmem_Adversarial`). The |
| 833 |
package operates on `[]byte` only; the generic top-level helpers `IsASCII`, |
| 834 |
`IndexAny2`, and `IndexAny3` dispatch into it automatically for inputs of |
| 835 |
`simd.MinLen`+ bytes on amd64, which is where the AVX2 kernels overtake the |
| 836 |
SWAR word loops (-35% to -88% ns/op at 32-512B in `benchstat -count=10` |
| 837 |
runs; shorter inputs keep the existing SWAR paths). |
| 838 |
|
| 839 |
The kernels are adapted from the [coregex](https://github.com/coregx/coregex) |
| 840 |
project's `simd` package (MIT License, Copyright (c) 2025 Andrey Kolkov and |
| 841 |
contributors; see [`simd/LICENSE`](simd/LICENSE)), with the legacy-SSE |
| 842 |
register moves in the kernels replaced by VEX-encoded ones to avoid AVX-SSE |
| 843 |
transition stalls, the scalar tail loops replaced by overlapping vector |
| 844 |
rescans at the buffer end (a 63-byte scan previously cost ~3.7x a 64-byte |
| 845 |
one), the 32-byte main loops replaced by 4x unrolled 128-byte blocks whose |
| 846 |
bound is tested once at the bottom against a precomputed limit pointer, the |
| 847 |
`\w` classifier rewritten from three `VPMINUB`/`VPMAXUB` clamp-and-compare |
| 848 |
range tests into two `VPSHUFB` nibble-table lookups (with the block test |
| 849 |
reduced to one compare over the four raw class values), the digit range |
| 850 |
test reduced from two signed compares and a `VPANDN` to one biased |
| 851 |
`VPADDB` and one compare, `FirstNonASCII` and `CountNonASCII` given |
| 852 |
kernels of their own (they were SWAR-only, and the count kernel's block |
| 853 |
loop accumulates in vector byte lanes rather than extracting and |
| 854 |
population-counting every vector's mask), the 128-byte block loops |
| 855 |
placed at fixed offsets inside a 32-byte code window so their throughput |
| 856 |
no longer depends on where the linker places each kernel, and the |
| 857 |
fallbacks reworked around the stdlib and the `swar` package as described |
| 858 |
above. |
| 859 |
|
| 860 |
Against the pre-unrolling kernels, `benchstat -count=10` on the machine |
| 861 |
below reports -26.6%/-49.7% ns/op for `Memchr2` at 512B/4096B, |
| 862 |
-17.6%/-34.3% for `Memchr3`, -13.4%/-24.6% for `MemchrPair`, |
| 863 |
-39.2%/-50.5% for `MemchrDigit`, -53.5%/-63.7% for `MemchrNotWord`, |
| 864 |
-42.2%/-65.7% for `IsASCII`, and -13.7%/-27.1% for `Memmem`, which rides |
| 865 |
the paired scan. Those percentages come from `benchstat` over ten runs of |
| 866 |
each side; the single-run table below is a catalog, not a base-vs-head |
| 867 |
comparison, so subtracting its rows from an older copy of it will not |
| 868 |
reproduce them. |
| 869 |
|
| 870 |
Two bands see no benefit and are worth stating plainly. Inputs below |
| 871 |
`simd.MinLen` never reach the kernels at all. Inputs of 32-127 bytes do |
| 872 |
reach them but skip the 128-byte block loop, so they pay its setup with |
| 873 |
nothing to amortize it against: across that band `benchstat` reports the |
| 874 |
class scans clearly ahead (`MemchrNotWord` -8.6% at 32B, -18.4% at 64B; |
| 875 |
`IsASCII` -5.0%/-4.3%), most rows statistically unchanged, and two small |
| 876 |
regressions — `MemchrDigit` +5.6% at 32B and `Memchr3` +3.8% at 64B. Read |
| 877 |
those small-input figures against the run's own noise floor: the `default` |
| 878 |
legs call unchanged stdlib code, so their movement bounds what a delta of |
| 879 |
that size means. They held within 1% in the run quoted here, but a later |
| 880 |
run on the same machine drifted up to 17% on those same rows, so anything |
| 881 |
under ~10% at 32-64B should be taken as "no measured change" unless its |
| 882 |
control legs are quiet. |
| 883 |
|
| 884 |
On the portable side, pinning each unrolled group of words with a reslice |
| 885 |
before loading at constant offsets inside it removes the per-load bounds |
| 886 |
check that `swar.Load8`'s own reslice otherwise repeats. Measured with |
| 887 |
`benchstat -count=10` against the same fallbacks, at 32B/512B/4KiB: |
| 888 |
`IsASCII` -28%/-60%/-63%, `CountNonASCII` -24%/-44%/-44%, |
| 889 |
`FirstNonASCII` -23%/-37%/-43%, `Memchr2` -19%/-23%/-25%, |
| 890 |
`MemchrDigit` -7%/-12%/-17%, `Memchr3` -8%/-13%/-18%, |
| 891 |
`MemchrWord` -11%/-8%/-11%, `MemchrNotWord` -5%/-7%/-6%. The tier a group |
| 892 |
adds costs one compare on inputs too short to use it, which shows up as |
| 893 |
+3% to +10% on some of the 8B fallback rows — a few tenths of a |
| 894 |
nanosecond, and only below the length where the group pays for itself. |
| 895 |
`utils.IsASCII` carries the same rework, so the two copies of that scan |
| 896 |
stay in step. |
| 897 |
|
| 898 |
Making the counting kernel finish its own sub-vector remainder (rather |
| 899 |
than splitting the input in Go and calling the SWAR loop for the tail) |
| 900 |
also removed a second non-inlinable call from every whole-vector input: |
| 901 |
`CountNonASCII` at 32B went from 11.3ns — behind its own fallback — to |
| 902 |
6.8ns, level with it, and it leads from 64B up. |
| 903 |
|
| 904 |
A later audit pass reworked the kernels and fallbacks once more; |
| 905 |
`benchstat -count=10` on the machine below, base vs. head, reports: |
| 906 |
|
| 907 |
- `MemchrDigit` -20% at 512B and -27% at 4KiB from the one-add, |
| 908 |
one-compare range test. |
| 909 |
- `MemchrWord` -13%/-11% and `MemchrNotWord` -4%/-10% at 512B/4KiB from |
| 910 |
comparing the reduced block once instead of every vector, and their |
| 911 |
SWAR fallbacks -36%/-41% at 32B, -40%/-43% at 64B and -43%/-45% at |
| 912 |
512B: 15 ALU operations per word instead of 26, from case-folding the |
| 913 |
two letter ranges into one test, a one-add underscore test, and a |
| 914 |
single shared ASCII gate. |
| 915 |
- `CountNonASCII` -15% at 512B and -41% at 4KiB, with 32B and 64B |
| 916 |
unchanged: the block loop counts in vector byte lanes (a signed compare |
| 917 |
against zero and a byte subtract per vector, flushed through `VPSADBW` |
| 918 |
every 127 blocks) instead of four port-0 `VPMOVMSKB` extractions per |
| 919 |
block. The remaining whole vectors are still extracted and |
| 920 |
population-counted, because the vector reduction is a fixed ten-cycle |
| 921 |
chain that one to three vectors cannot amortize — a first version that |
| 922 |
used the accumulators for those too was 20% slower at 32-64B. |
| 923 |
- `MemchrPair`'s SWAR fallback -33% at 32B, -41% at 64B, -51% at 512B and |
| 924 |
-52% at 4KiB, and `MemchrPair` itself -30% at 32B, where the dispatch |
| 925 |
routes to that fallback: it now scans two words per branch through |
| 926 |
pinned three-index windows (no per-load capacity check or pointer |
| 927 |
clamp) and finishes with one overlapping word instead of a scalar |
| 928 |
tail. Before, at 32B, it ran no faster than a plain scalar loop. |
| 929 |
- `Memmem` -62% at 96B: needles that take the paired prefilter are routed |
| 930 |
through it from 65-byte haystacks, where `bytes.Index` leaves its |
| 931 |
brute-force vector kernel for a first-byte-anchored loop; 64B and |
| 932 |
128B+ are unchanged. |
| 933 |
|
| 934 |
The same pinned-window rework applied to the case-conversion loops in |
| 935 |
`internal/caseconv`, which the `strings` and `bytes` packages' `ToLower` |
| 936 |
and `ToUpper` build on, gives on the same machine -27% to -37% ns/op for |
| 937 |
the in-place `UnsafeToLower`/`UnsafeToUpper` at 39-64B, -14% to -19% for |
| 938 |
the scan-only path that finds nothing to convert, and -5% to -17% for the |
| 939 |
allocating conversions, where the allocation dominates. The arm64 catalog |
| 940 |
rows above were not regenerated for that change. |
| 941 |
|
| 942 |
Comparing the base and head test binaries also showed the untouched |
| 943 |
`MemchrPair` kernel ~10% slower at 4KiB, purely because the linker had |
| 944 |
moved its entry by 32 bytes: on Skylake-derived cores the JCC erratum |
| 945 |
mitigation keeps a macro-fused compare-and-branch that crosses or ends on |
| 946 |
a 32-byte boundary out of the decoded-uop cache, so the block loop ran |
| 947 |
from the legacy decoder. Every block loop is now placed by a `BLOCKALIGN` |
| 948 |
macro at a window offset where all of its fused pairs fit (a few |
| 949 |
once-per-call NOPs, visible as +5% on `Memchr2` at 512B and nothing at |
| 950 |
4KiB), and an amd64 test reads each kernel's code and fails if a later |
| 951 |
edit lets a pair straddle a boundary again. |
| 952 |
|
| 953 |
Because the AVX2 kernels only engage on amd64, their benchmark numbers are |
| 954 |
recorded separately from the arm64 catalog above: |
| 955 |
|
| 956 |
Environment: |
| 957 |
goos: linux |
| 958 |
goarch: amd64 |
| 959 |
pkg: github.com/gofiber/utils/v2/simd |
| 960 |
cpu: Intel(R) Xeon(R) Processor @ 2.80GHz (AVX2) |
| 961 |
|
| 962 |
```text |
| 963 |
// go test ./simd/ -benchmem -run=^$ -bench=Benchmark_ -count=1 |
| 964 |
Benchmark_Memchr2/8B/simd-4 190047766 6.344 ns/op 0 B/op 0 allocs/op |
| 965 |
Benchmark_Memchr2/8B/scalar-4 216903783 5.516 ns/op 0 B/op 0 allocs/op |
| 966 |
Benchmark_Memchr2/8B/default-4 37047232 34.54 ns/op 0 B/op 0 allocs/op |
| 967 |
Benchmark_Memchr2/32B/simd-4 230568829 5.549 ns/op 0 B/op 0 allocs/op |
| 968 |
Benchmark_Memchr2/32B/scalar-4 137118788 9.346 ns/op 0 B/op 0 allocs/op |
| 969 |
Benchmark_Memchr2/32B/default-4 37159426 34.23 ns/op 0 B/op 0 allocs/op |
| 970 |
Benchmark_Memchr2/64B/simd-4 202942682 5.969 ns/op 0 B/op 0 allocs/op |
| 971 |
Benchmark_Memchr2/64B/scalar-4 87153786 13.77 ns/op 0 B/op 0 allocs/op |
| 972 |
Benchmark_Memchr2/64B/default-4 23353054 54.76 ns/op 0 B/op 0 allocs/op |
| 973 |
Benchmark_Memchr2/512B/simd-4 85724174 13.67 ns/op 0 B/op 0 allocs/op |
| 974 |
Benchmark_Memchr2/512B/scalar-4 13201143 89.39 ns/op 0 B/op 0 allocs/op |
| 975 |
Benchmark_Memchr2/512B/default-4 3530156 348.3 ns/op 0 B/op 0 allocs/op |
| 976 |
Benchmark_Memchr2/4096B/simd-4 18950438 63.19 ns/op 0 B/op 0 allocs/op |
| 977 |
Benchmark_Memchr2/4096B/scalar-4 1703708 698.6 ns/op 0 B/op 0 allocs/op |
| 978 |
Benchmark_Memchr2/4096B/default-4 451885 2773 ns/op 0 B/op 0 allocs/op |
| 979 |
Benchmark_Memchr3/8B/simd-4 161230975 7.399 ns/op 0 B/op 0 allocs/op |
| 980 |
Benchmark_Memchr3/8B/scalar-4 195079063 6.568 ns/op 0 B/op 0 allocs/op |
| 981 |
Benchmark_Memchr3/8B/default-4 39049345 31.96 ns/op 0 B/op 0 allocs/op |
| 982 |
Benchmark_Memchr3/32B/simd-4 209563508 5.767 ns/op 0 B/op 0 allocs/op |
| 983 |
Benchmark_Memchr3/32B/scalar-4 100000000 11.80 ns/op 0 B/op 0 allocs/op |
| 984 |
Benchmark_Memchr3/32B/default-4 36763602 33.60 ns/op 0 B/op 0 allocs/op |
| 985 |
Benchmark_Memchr3/64B/simd-4 186953884 6.553 ns/op 0 B/op 0 allocs/op |
| 986 |
Benchmark_Memchr3/64B/scalar-4 59549791 20.13 ns/op 0 B/op 0 allocs/op |
| 987 |
Benchmark_Memchr3/64B/default-4 22672693 54.92 ns/op 0 B/op 0 allocs/op |
| 988 |
Benchmark_Memchr3/512B/simd-4 75757986 16.84 ns/op 0 B/op 0 allocs/op |
| 989 |
Benchmark_Memchr3/512B/scalar-4 9159388 128.2 ns/op 0 B/op 0 allocs/op |
| 990 |
Benchmark_Memchr3/512B/default-4 3351171 348.3 ns/op 0 B/op 0 allocs/op |
| 991 |
Benchmark_Memchr3/4096B/simd-4 12609099 93.35 ns/op 0 B/op 0 allocs/op |
| 992 |
Benchmark_Memchr3/4096B/scalar-4 1000000 1064 ns/op 0 B/op 0 allocs/op |
| 993 |
Benchmark_Memchr3/4096B/default-4 470744 2615 ns/op 0 B/op 0 allocs/op |
| 994 |
Benchmark_MemchrPair/8B/simd-4 100000000 10.56 ns/op 0 B/op 0 allocs/op |
| 995 |
Benchmark_MemchrPair/8B/swar-4 152141828 7.801 ns/op 0 B/op 0 allocs/op |
| 996 |
Benchmark_MemchrPair/8B/scalar-4 201085015 6.059 ns/op 0 B/op 0 allocs/op |
| 997 |
Benchmark_MemchrPair/32B/simd-4 88059698 13.00 ns/op 0 B/op 0 allocs/op |
| 998 |
Benchmark_MemchrPair/32B/swar-4 100000000 10.63 ns/op 0 B/op 0 allocs/op |
| 999 |
Benchmark_MemchrPair/32B/scalar-4 68842016 16.81 ns/op 0 B/op 0 allocs/op |
| 1000 |
Benchmark_MemchrPair/64B/simd-4 156794418 7.975 ns/op 0 B/op 0 allocs/op |
| 1001 |
Benchmark_MemchrPair/64B/swar-4 75119947 16.98 ns/op 0 B/op 0 allocs/op |
| 1002 |
Benchmark_MemchrPair/64B/scalar-4 33130292 32.27 ns/op 0 B/op 0 allocs/op |
| 1003 |
Benchmark_MemchrPair/512B/simd-4 63940441 18.19 ns/op 0 B/op 0 allocs/op |
| 1004 |
Benchmark_MemchrPair/512B/swar-4 11641740 103.3 ns/op 0 B/op 0 allocs/op |
| 1005 |
Benchmark_MemchrPair/512B/scalar-4 4559438 269.0 ns/op 0 B/op 0 allocs/op |
| 1006 |
Benchmark_MemchrPair/4096B/simd-4 17142175 70.75 ns/op 0 B/op 0 allocs/op |
| 1007 |
Benchmark_MemchrPair/4096B/swar-4 1548690 776.4 ns/op 0 B/op 0 allocs/op |
| 1008 |
Benchmark_MemchrPair/4096B/scalar-4 563876 2072 ns/op 0 B/op 0 allocs/op |
| 1009 |
Benchmark_MemchrDigit/8B/simd-4 195955126 5.458 ns/op 0 B/op 0 allocs/op |
| 1010 |
Benchmark_MemchrDigit/8B/scalar-4 267192732 4.378 ns/op 0 B/op 0 allocs/op |
| 1011 |
Benchmark_MemchrDigit/32B/simd-4 248331692 4.985 ns/op 0 B/op 0 allocs/op |
| 1012 |
Benchmark_MemchrDigit/32B/scalar-4 134102625 8.622 ns/op 0 B/op 0 allocs/op |
| 1013 |
Benchmark_MemchrDigit/64B/simd-4 212405679 5.785 ns/op 0 B/op 0 allocs/op |
| 1014 |
Benchmark_MemchrDigit/64B/scalar-4 72030652 15.22 ns/op 0 B/op 0 allocs/op |
| 1015 |
Benchmark_MemchrDigit/512B/simd-4 124923620 9.429 ns/op 0 B/op 0 allocs/op |
| 1016 |
Benchmark_MemchrDigit/512B/scalar-4 11478067 103.1 ns/op 0 B/op 0 allocs/op |
| 1017 |
Benchmark_MemchrDigit/4096B/simd-4 24760083 47.52 ns/op 0 B/op 0 allocs/op |
| 1018 |
Benchmark_MemchrDigit/4096B/scalar-4 1490264 800.2 ns/op 0 B/op 0 allocs/op |
| 1019 |
Benchmark_MemchrWord/8B/simd-4 153120554 8.104 ns/op 0 B/op 0 allocs/op |
| 1020 |
Benchmark_MemchrWord/8B/scalar-4 186279788 6.460 ns/op 0 B/op 0 allocs/op |
| 1021 |
Benchmark_MemchrWord/32B/simd-4 205711502 5.958 ns/op 0 B/op 0 allocs/op |
| 1022 |
Benchmark_MemchrWord/32B/scalar-4 86716185 14.24 ns/op 0 B/op 0 allocs/op |
| 1023 |
Benchmark_MemchrWord/64B/simd-4 185673494 6.833 ns/op 0 B/op 0 allocs/op |
| 1024 |
Benchmark_MemchrWord/64B/scalar-4 48932490 25.11 ns/op 0 B/op 0 allocs/op |
| 1025 |
Benchmark_MemchrWord/512B/simd-4 61637564 16.98 ns/op 0 B/op 0 allocs/op |
| 1026 |
Benchmark_MemchrWord/512B/scalar-4 6845524 174.5 ns/op 0 B/op 0 allocs/op |
| 1027 |
Benchmark_MemchrWord/4096B/simd-4 12697916 92.19 ns/op 0 B/op 0 allocs/op |
| 1028 |
Benchmark_MemchrWord/4096B/scalar-4 881439 1442 ns/op 0 B/op 0 allocs/op |
| 1029 |
Benchmark_MemchrNotWord/8B/simd-4 167067980 7.307 ns/op 0 B/op 0 allocs/op |
| 1030 |
Benchmark_MemchrNotWord/8B/scalar-4 189991910 6.302 ns/op 0 B/op 0 allocs/op |
| 1031 |
Benchmark_MemchrNotWord/32B/simd-4 205724659 5.578 ns/op 0 B/op 0 allocs/op |
| 1032 |
Benchmark_MemchrNotWord/32B/scalar-4 79661326 13.15 ns/op 0 B/op 0 allocs/op |
| 1033 |
Benchmark_MemchrNotWord/64B/simd-4 185518209 6.497 ns/op 0 B/op 0 allocs/op |
| 1034 |
Benchmark_MemchrNotWord/64B/scalar-4 47755200 24.15 ns/op 0 B/op 0 allocs/op |
| 1035 |
Benchmark_MemchrNotWord/512B/simd-4 70365358 16.62 ns/op 0 B/op 0 allocs/op |
| 1036 |
Benchmark_MemchrNotWord/512B/scalar-4 6722820 172.3 ns/op 0 B/op 0 allocs/op |
| 1037 |
Benchmark_MemchrNotWord/4096B/simd-4 13096357 93.62 ns/op 0 B/op 0 allocs/op |
| 1038 |
Benchmark_MemchrNotWord/4096B/scalar-4 892350 1366 ns/op 0 B/op 0 allocs/op |
| 1039 |
Benchmark_Memmem/8B/simd-4 100000000 10.19 ns/op 0 B/op 0 allocs/op |
| 1040 |
Benchmark_Memmem/8B/default-4 148054586 7.966 ns/op 0 B/op 0 allocs/op |
| 1041 |
Benchmark_Memmem/32B/simd-4 98693811 12.81 ns/op 0 B/op 0 allocs/op |
| 1042 |
Benchmark_Memmem/32B/default-4 100000000 10.89 ns/op 0 B/op 0 allocs/op |
| 1043 |
Benchmark_Memmem/64B/simd-4 75442142 15.92 ns/op 0 B/op 0 allocs/op |
| 1044 |
Benchmark_Memmem/64B/default-4 81081360 13.98 ns/op 0 B/op 0 allocs/op |
| 1045 |
Benchmark_Memmem/96B/simd-4 56509897 19.39 ns/op 0 B/op 0 allocs/op |
| 1046 |
Benchmark_Memmem/96B/default-4 25670028 47.21 ns/op 0 B/op 0 allocs/op |
| 1047 |
Benchmark_Memmem/128B/simd-4 62137202 20.18 ns/op 0 B/op 0 allocs/op |
| 1048 |
Benchmark_Memmem/128B/default-4 21325711 57.92 ns/op 0 B/op 0 allocs/op |
| 1049 |
Benchmark_Memmem/192B/simd-4 57145284 21.37 ns/op 0 B/op 0 allocs/op |
| 1050 |
Benchmark_Memmem/192B/default-4 12855652 92.65 ns/op 0 B/op 0 allocs/op |
| 1051 |
Benchmark_Memmem/512B/simd-4 45782227 26.28 ns/op 0 B/op 0 allocs/op |
| 1052 |
Benchmark_Memmem/512B/default-4 4696874 258.5 ns/op 0 B/op 0 allocs/op |
| 1053 |
Benchmark_Memmem/4096B/simd-4 15384080 80.64 ns/op 0 B/op 0 allocs/op |
| 1054 |
Benchmark_Memmem/4096B/default-4 566840 2110 ns/op 0 B/op 0 allocs/op |
| 1055 |
Benchmark_Memmem_Prefilter/8B/paired-4 100722044 12.11 ns/op 0 B/op 0 allocs/op |
| 1056 |
Benchmark_Memmem_Prefilter/8B/paired-stdlib-4 156602451 7.970 ns/op 0 B/op 0 allocs/op |
| 1057 |
Benchmark_Memmem_Prefilter/32B/paired-4 63617959 16.69 ns/op 0 B/op 0 allocs/op |
| 1058 |
Benchmark_Memmem_Prefilter/32B/paired-stdlib-4 100000000 11.05 ns/op 0 B/op 0 allocs/op |
| 1059 |
Benchmark_Memmem_Prefilter/32B/single-4 83176831 14.12 ns/op 0 B/op 0 allocs/op |
| 1060 |
Benchmark_Memmem_Prefilter/32B/single-stdlib-4 80788734 15.91 ns/op 0 B/op 0 allocs/op |
| 1061 |
Benchmark_Memmem_Prefilter/64B/paired-4 91946842 12.97 ns/op 0 B/op 0 allocs/op |
| 1062 |
Benchmark_Memmem_Prefilter/64B/paired-stdlib-4 86483179 13.90 ns/op 0 B/op 0 allocs/op |
| 1063 |
Benchmark_Memmem_Prefilter/64B/single-4 35353610 32.88 ns/op 0 B/op 0 allocs/op |
| 1064 |
Benchmark_Memmem_Prefilter/64B/single-stdlib-4 33454047 35.61 ns/op 0 B/op 0 allocs/op |
| 1065 |
Benchmark_Memmem_Prefilter/96B/paired-4 90596826 13.71 ns/op 0 B/op 0 allocs/op |
| 1066 |
Benchmark_Memmem_Prefilter/96B/paired-stdlib-4 26030700 45.55 ns/op 0 B/op 0 allocs/op |
| 1067 |
Benchmark_Memmem_Prefilter/96B/single-4 26503994 44.73 ns/op 0 B/op 0 allocs/op |
| 1068 |
Benchmark_Memmem_Prefilter/96B/single-stdlib-4 36078775 33.98 ns/op 0 B/op 0 allocs/op |
| 1069 |
Benchmark_Memmem_Prefilter/128B/paired-4 81232996 14.57 ns/op 0 B/op 0 allocs/op |
| 1070 |
Benchmark_Memmem_Prefilter/128B/paired-stdlib-4 21295238 56.58 ns/op 0 B/op 0 allocs/op |
| 1071 |
Benchmark_Memmem_Prefilter/128B/single-4 19797116 61.11 ns/op 0 B/op 0 allocs/op |
| 1072 |
Benchmark_Memmem_Prefilter/128B/single-stdlib-4 25664023 46.42 ns/op 0 B/op 0 allocs/op |
| 1073 |
Benchmark_Memmem_Prefilter/192B/paired-4 78041734 15.73 ns/op 0 B/op 0 allocs/op |
| 1074 |
Benchmark_Memmem_Prefilter/192B/paired-stdlib-4 13159070 91.53 ns/op 0 B/op 0 allocs/op |
| 1075 |
Benchmark_Memmem_Prefilter/192B/single-4 12339504 99.01 ns/op 0 B/op 0 allocs/op |
| 1076 |
Benchmark_Memmem_Prefilter/192B/single-stdlib-4 14733991 81.86 ns/op 0 B/op 0 allocs/op |
| 1077 |
Benchmark_Memmem_Prefilter/512B/paired-4 55724107 21.69 ns/op 0 B/op 0 allocs/op |
| 1078 |
Benchmark_Memmem_Prefilter/512B/paired-stdlib-4 4627340 261.9 ns/op 0 B/op 0 allocs/op |
| 1079 |
Benchmark_Memmem_Prefilter/512B/single-4 4143304 285.8 ns/op 0 B/op 0 allocs/op |
| 1080 |
Benchmark_Memmem_Prefilter/512B/single-stdlib-4 4889746 246.2 ns/op 0 B/op 0 allocs/op |
| 1081 |
Benchmark_Memmem_Prefilter/4096B/paired-4 15190396 76.16 ns/op 0 B/op 0 allocs/op |
| 1082 |
Benchmark_Memmem_Prefilter/4096B/paired-stdlib-4 571941 2135 ns/op 0 B/op 0 allocs/op |
| 1083 |
Benchmark_Memmem_Prefilter/4096B/single-4 558564 2160 ns/op 0 B/op 0 allocs/op |
| 1084 |
Benchmark_Memmem_Prefilter/4096B/single-stdlib-4 539943 2120 ns/op 0 B/op 0 allocs/op |
| 1085 |
Benchmark_Memmem_Adversarial/simd-4 721 1676433 ns/op 0 B/op 0 allocs/op |
| 1086 |
Benchmark_Memmem_Adversarial/default-4 729 1660342 ns/op 0 B/op 0 allocs/op |
| 1087 |
Benchmark_IsASCII/8B/simd-4 287283123 4.187 ns/op 0 B/op 0 allocs/op |
| 1088 |
Benchmark_IsASCII/8B/swar-4 469731259 2.536 ns/op 0 B/op 0 allocs/op |
| 1089 |
Benchmark_IsASCII/32B/simd-4 295464411 4.118 ns/op 0 B/op 0 allocs/op |
| 1090 |
Benchmark_IsASCII/32B/swar-4 292665852 4.148 ns/op 0 B/op 0 allocs/op |
| 1091 |
Benchmark_IsASCII/64B/simd-4 240708138 4.706 ns/op 0 B/op 0 allocs/op |
| 1092 |
Benchmark_IsASCII/64B/swar-4 220235487 5.569 ns/op 0 B/op 0 allocs/op |
| 1093 |
Benchmark_IsASCII/512B/simd-4 192368624 6.454 ns/op 0 B/op 0 allocs/op |
| 1094 |
Benchmark_IsASCII/512B/swar-4 54892551 21.45 ns/op 0 B/op 0 allocs/op |
| 1095 |
Benchmark_IsASCII/4096B/simd-4 43729008 27.50 ns/op 0 B/op 0 allocs/op |
| 1096 |
Benchmark_IsASCII/4096B/swar-4 7511167 157.0 ns/op 0 B/op 0 allocs/op |
| 1097 |
Benchmark_FirstNonASCII/8B/simd-4 260435899 4.724 ns/op 0 B/op 0 allocs/op |
| 1098 |
Benchmark_FirstNonASCII/8B/swar-4 341475208 3.574 ns/op 0 B/op 0 allocs/op |
| 1099 |
Benchmark_FirstNonASCII/32B/simd-4 297709566 4.219 ns/op 0 B/op 0 allocs/op |
| 1100 |
Benchmark_FirstNonASCII/32B/swar-4 227647696 5.171 ns/op 0 B/op 0 allocs/op |
| 1101 |
Benchmark_FirstNonASCII/64B/simd-4 267531430 4.636 ns/op 0 B/op 0 allocs/op |
| 1102 |
Benchmark_FirstNonASCII/64B/swar-4 160438296 7.334 ns/op 0 B/op 0 allocs/op |
| 1103 |
Benchmark_FirstNonASCII/512B/simd-4 170822334 7.301 ns/op 0 B/op 0 allocs/op |
| 1104 |
Benchmark_FirstNonASCII/512B/swar-4 34065859 34.89 ns/op 0 B/op 0 allocs/op |
| 1105 |
Benchmark_FirstNonASCII/4096B/simd-4 43481222 27.70 ns/op 0 B/op 0 allocs/op |
| 1106 |
Benchmark_FirstNonASCII/4096B/swar-4 4615596 254.2 ns/op 0 B/op 0 allocs/op |
| 1107 |
Benchmark_CountNonASCII/8B/simd-4 205752014 5.746 ns/op 0 B/op 0 allocs/op |
| 1108 |
Benchmark_CountNonASCII/8B/swar-4 281060181 4.143 ns/op 0 B/op 0 allocs/op |
| 1109 |
Benchmark_CountNonASCII/32B/simd-4 274114710 4.472 ns/op 0 B/op 0 allocs/op |
| 1110 |
Benchmark_CountNonASCII/32B/swar-4 206395050 5.781 ns/op 0 B/op 0 allocs/op |
| 1111 |
Benchmark_CountNonASCII/64B/simd-4 242445574 4.774 ns/op 0 B/op 0 allocs/op |
| 1112 |
Benchmark_CountNonASCII/64B/swar-4 139845796 8.224 ns/op 0 B/op 0 allocs/op |
| 1113 |
Benchmark_CountNonASCII/512B/simd-4 143031885 8.239 ns/op 0 B/op 0 allocs/op |
| 1114 |
Benchmark_CountNonASCII/512B/swar-4 27194380 43.84 ns/op 0 B/op 0 allocs/op |
| 1115 |
Benchmark_CountNonASCII/4096B/simd-4 33436537 35.32 ns/op 0 B/op 0 allocs/op |
| 1116 |
Benchmark_CountNonASCII/4096B/swar-4 3573552 334.1 ns/op 0 B/op 0 allocs/op |
| 1117 |
``` |
| 1118 |
|
| 1119 |
<!-- skip-docs --> |
| 1120 |
## ☕ Supporters |
| 1121 |
|
| 1122 |
Fiber is an open-source project that runs on donations to pay the bills, e.g., our domain name, hosting, and serverless infrastructure. If you want to support Fiber, please become a [GitHub Sponsor](https://github.com/sponsors/gofiber). |
| 1123 |
|
| 1124 |
<p align="center"> |
| 1125 |
<a href="https://www.coderabbit.ai/?utm_source=gofiber&utm_medium=sponsor&utm_content=readme"> |
| 1126 |
<picture> |
| 1127 |
<source media="(prefers-color-scheme: dark)" srcset="https://www.coderabbit.ai/images/logo-dark.svg"> |
| 1128 |
<img width="280" height="52" alt="CodeRabbit" src="https://www.coderabbit.ai/images/logo-orange.svg"> |
| 1129 |
</picture> |
| 1130 |
</a> |
| 1131 |
</p> |
| 1132 |
<p align="center"> |
| 1133 |
<a href="https://blacksmith.sh/?utm_source=gofiber&utm_medium=sponsor&utm_content=readme"> |
| 1134 |
<img width="280" height="96" alt="Blacksmith" src="https://raw.githubusercontent.com/gofiber/.github/main/assets/sponsors/blacksmith.png"> |
| 1135 |
</a> |
| 1136 |
</p> |
| 1137 |
<p align="center"> |
| 1138 |
<sub><b>Tool Sponsors</b> - supporting Fiber with free IDE licenses and AI credits</sub> |
| 1139 |
</p> |
| 1140 |
<p align="center"> |
| 1141 |
<a href="https://www.jetbrains.com/?from=gofiber" title="JetBrains - IDE licenses"><img width="36" height="36" alt="JetBrains" src="https://github.com/JetBrains.png?size=72"></a> |
| 1142 |
|
| 1143 |
<a href="https://openai.com/?utm_source=gofiber&utm_medium=sponsor&utm_content=readme" title="OpenAI - AI credits"><img width="36" height="36" alt="OpenAI" src="https://github.com/openai.png?size=72"></a> |
| 1144 |
|
| 1145 |
<a href="https://www.anthropic.com/?utm_source=gofiber&utm_medium=sponsor&utm_content=readme" title="Anthropic - AI credits"><img width="36" height="36" alt="Anthropic" src="https://github.com/anthropics.png?size=72"></a> |
| 1146 |
</p> |
| 1147 |
|
| 1148 |
<!-- sponsors --> |
| 1149 |
|
| 1150 |
### 📅 Monthly Sponsors |
| 1151 |
|
| 1152 |
<table> |
| 1153 |
<tr><td valign="top"><strong>🔥 Fiber Guardian</strong></td><td><a href="https://www.coderabbit.ai/?utm_source=cr_org&utm_medium=github" title="@coderabbitai"><img src="https://github.com/coderabbitai.png" width="50" alt="@coderabbitai" /></a></td></tr> |
| 1154 |
<tr><td valign="top"><strong>☕ Fiber Supporter</strong></td><td><a href="https://ndole.studio" title="@NdoleStudio"><img src="https://github.com/NdoleStudio.png" width="34" alt="@NdoleStudio" /></a></td></tr> |
| 1155 |
<tr><td valign="top"><strong>🪴 Fiber Friend</strong></td><td><a href="https://github.com/simonheisstpeter" title="@simonheisstpeter"><img src="https://github.com/simonheisstpeter.png" width="32" alt="@simonheisstpeter" /></a></td></tr> |
| 1156 |
</table> |
| 1157 |
|
| 1158 |
### 🎁 One-time Sponsors |
| 1159 |
|
| 1160 |
<table> |
| 1161 |
<tr><td valign="top"><strong>🚀 Fiber Hero</strong></td><td><a href="https://www.thanks.dev" title="@thnxdev"><img src="https://github.com/thnxdev.png" width="40" alt="@thnxdev" /></a></td></tr> |
| 1162 |
<tr><td valign="top"><strong>🪴 Fiber Friend</strong></td><td><a href="https://github.com/Gl1tchedPixzl" title="@Gl1tchedPixzl"><img src="https://github.com/Gl1tchedPixzl.png" width="26" alt="@Gl1tchedPixzl" /></a></td></tr> |
| 1163 |
</table> |
| 1164 |
<!-- sponsors --> |
| 1165 |
<!-- skip-docs --> |