Commit Graph

24 Commits

Author SHA1 Message Date
Erik Dubbelboer c2b317d47d Go 1.26 and golangci-lint updates (#2146)
Keep Go 1.24 compatibility for now (by not using `wg.Go()`).
2026-02-21 10:28:39 +01:00
Kashiwa e2bb2e0d64 Improve performance of ParseUfloat (#1865)
* Improve performance of ParseUfloat function

Replaced `offset` handling logic with more efficient math.Pow10 based calculation.

goos: linux
goarch: amd64
pkg: github.com/valyala/fasthttp
cpu: Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
              │   old.txt   │           new.txt           │
              │   sec/op    │   sec/op     vs base        │
ParseUfloat-8   44.22n ± 0%   31.06n ± 0%  -29.76% (n=50)

* fix: lint error return value is not checked

* Handling uint64 overflow issues

* Implement ParseUfloat by calling strconv.ParseFloat

* fix: lint error
2024-09-22 15:46:29 +02:00
Erik Dubbelboer 7a5afddf5b Use %v for errors and %q for strings (#1262)
Mostly in tests.
2022-04-01 18:11:16 +02:00
Erik Dubbelboer 32793db72d Run golangci-lint using a Github Action 2019-11-16 18:09:28 +01:00
ZYunH be93fbd21b Add lowerhex 2019-09-20 06:33:34 +03:00
Erik Dubbelboer d4f0cf56d8 Remove fasthttp.ByteBuffer
As advertised in https://github.com/valyala/fasthttp/commit/b5f96d4b4120bb1e09c23ac32baf21a14da4a71d
2018-10-01 14:15:29 +08:00
Aliaksandr Valialkin d257ae60a3 ioptimized decodeArgAppend a bit
Benchmark results on linux/amd64:

name                           old time/op  new time/op  delta
ArgsParse-4                    72.8ns ± 2%  68.0ns ± 2%  -6.59%  (p=0.000 n=10+9)
AppendUnquotedArgFastPath-4    20.4ns ± 2%  21.1ns ± 9%    ~     (p=0.614 n=8+10)
AppendUnquotedArgSlowPath-4    68.9ns ± 3%  70.4ns ± 6%    ~     (p=0.148 n=9+10)
URIParsePath-4                 80.9ns ± 2%  78.7ns ± 2%  -2.80%  (p=0.000 n=10+10)
URIParsePathQueryString-4      88.9ns ± 1%  86.3ns ± 1%  -2.90%  (p=0.000 n=10+8)
URIParsePathQueryStringHash-4  95.7ns ± 8%  91.0ns ± 1%  -4.88%  (p=0.000 n=9+10)
URIParseHostname-4             98.6ns ± 1%  95.4ns ± 1%  -3.24%  (p=0.000 n=10+10)
2017-07-21 16:08:21 +03:00
Aliaksandr Valialkin 2db9429ff7 added a fast path to decodeArgAppend when the arg doesnt contain encoded chars 2017-06-20 13:40:15 +03:00
Aliaksandr Valialkin 394c20fdc5 Added AppendHTMLEscape helper function 2016-02-15 16:53:44 +02:00
Aliaksandr Valialkin 80368e6491 Switch from bytes.Buffer to ByteBuffer where appropriate 2016-02-12 14:07:56 +02:00
Aliaksandr Valialkin 052a3cfb65 Substitute EqualBytesStr(s, b) by string(b) == s 2015-12-19 20:44:01 +02:00
Aliaksandr Valialkin 3222ab8c8c Added AppendIPv4 and ParseIPv4 helper functions 2015-12-11 13:11:15 +02:00
Aliaksandr Valialkin 996917ddf4 gofmt 2015-11-30 20:25:28 +02:00
Aliaksandr Valialkin 51d53b7acc Updated int <-> hex benchmarks 2015-11-30 20:10:52 +02:00
Aliaksandr Valialkin bf20fa37e4 Fixed a typo 2015-11-30 20:07:22 +02:00
Aliaksandr Valialkin 192c5af2fa Added a benchmark for int2hexbyte 2015-11-30 20:05:49 +02:00
Aliaksandr Valialkin d4b0c51398 Added a benchmark for hex->int conversion 2015-11-30 19:53:41 +02:00
Aliaksandr Valialkin 741affeb8a added a benchmark for ParseUint 2015-11-29 13:38:35 +02:00
Aliaksandr Valialkin 5d4db43538 Added a benchmark for writeHexInt 2015-11-28 23:07:25 +02:00
Aliaksandr Valialkin 1f97e8d9d6 Added timing test for AppendUint 2015-11-28 22:58:52 +02:00
Aliaksandr Valialkin b31fd30964 Added benchmark for comparing unequal strings with EqualBytesStr 2015-11-26 17:57:44 +02:00
Aliaksandr Valialkin 29de7735ce Added benchmark for AppendBytesStr 2015-11-24 13:21:13 +02:00
Aliaksandr Valialkin 961eef082b Optimized EqualBytesStr 2015-11-24 12:57:01 +02:00
Aliaksandr Valialkin 5e36ee0947 Added benchmarks for lowercaseBytes 2015-11-23 16:58:29 +02:00