aboutsummaryrefslogtreecommitdiff
path: root/uri.go
diff options
context:
space:
mode:
authorGravatar Aliaksandr Valialkin <valyala@gmail.com> 2017-07-21 16:08:18 +0300
committerGravatar Aliaksandr Valialkin <valyala@gmail.com> 2017-07-21 16:08:21 +0300
commitd257ae60a32c5605ac63b2f4f0f80a0dcffb0719 (patch)
tree57fb09fe77e486b193ad72ca6766ce37b13be433 /uri.go
parentIssue #278: more optimizations for normalizeHeaderKey (diff)
downloadfasthttp-d257ae60a32c5605ac63b2f4f0f80a0dcffb0719.tar.gz
fasthttp-d257ae60a32c5605ac63b2f4f0f80a0dcffb0719.tar.bz2
fasthttp-d257ae60a32c5605ac63b2f4f0f80a0dcffb0719.zip
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)
Diffstat (limited to 'uri.go')
-rw-r--r--uri.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/uri.go b/uri.go
index 0f6bc04..1d10e47 100644
--- a/uri.go
+++ b/uri.go
@@ -277,7 +277,7 @@ func (u *URI) parse(host, uri []byte, h *RequestHeader) {
func normalizePath(dst, src []byte) []byte {
dst = dst[:0]
dst = addLeadingSlash(dst, src)
- dst = decodeArgAppend(dst, src, false)
+ dst = decodeArgAppendNoPlus(dst, src)
// remove duplicate slashes
b := dst