]> Cypherpunks repositories - gostls13.git/commit
net/url: use strings.IndexByte instead of strings.Index in split function
authorMartin Möhrmann <moehrmann@google.com>
Sat, 25 May 2019 12:23:34 +0000 (14:23 +0200)
committerDaniel Martí <mvdan@mvdan.cc>
Wed, 28 Aug 2019 10:04:01 +0000 (10:04 +0000)
commit5ff12f6269c5851cfb762357d12e9ed1e3d582e9
tree3f9a907c471ea1afbe27c01310f55a24b9fd0b82
parent6a73e94c10b9c2a3162722f0eb4584dc6445cae5
net/url: use strings.IndexByte instead of strings.Index in split function

Production profiling shows ~15% of url.Parse time being spend in the overhead
of calling strings.IndexByte through strings.Index instead of calling
strings.IndexByte directly.

name   old time/op  new time/op  delta
Split  15.5ns ± 2%  10.7ns ± 3%  -30.98%  (p=0.000 n=20+19)

Change-Id: Ie25dd4afa93539a1335a91ab2a4a367f97bd3df0
Reviewed-on: https://go-review.googlesource.com/c/go/+/178877
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/net/url/url.go
src/net/url/url_test.go