]> Cypherpunks repositories - gostls13.git/commit
regexp: don't allocate when All methods find no matches
authorJosh Bleecher Snyder <josharian@gmail.com>
Mon, 18 Dec 2017 18:53:55 +0000 (10:53 -0800)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 13 Feb 2018 18:44:40 +0000 (18:44 +0000)
commitdf5997b99b9a89e1198596366230fa6c4dd50b70
treee52ebadceac886d89e1debc251f3eeca21a2816c
parent4b8a7eafef039af1834ef9bfa879257c4a72b7b5
regexp: don't allocate when All methods find no matches

name                old time/op    new time/op    delta
FindAllNoMatches-8     216ns ± 3%     122ns ± 2%   -43.52%  (p=0.000 n=10+10)

name                old alloc/op   new alloc/op   delta
FindAllNoMatches-8      240B ± 0%        0B       -100.00%  (p=0.000 n=10+10)

name                old allocs/op  new allocs/op  delta
FindAllNoMatches-8      1.00 ± 0%      0.00       -100.00%  (p=0.000 n=10+10)

This work was supported by Sourcegraph.

Change-Id: I30aac201370ccfb40a6ff637402020ac20f61f70
Reviewed-on: https://go-review.googlesource.com/87418
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/regexp/all_test.go
src/regexp/regexp.go