]> Cypherpunks repositories - gostls13.git/commit
regexp: revert "use sync.Pool to cache regexp.machine objects"
authorRuss Cox <rsc@golang.org>
Mon, 9 Jul 2018 14:55:36 +0000 (10:55 -0400)
committerRuss Cox <rsc@golang.org>
Mon, 9 Jul 2018 15:12:53 +0000 (15:12 +0000)
commita41d21695cad0e30d9c006198cd7edd8c38bf885
tree82730e8fbf7f0f5a34c60cfaf00677f96c72c0bc
parent7254cfc37b3a93a6e83dae22c4bfd6f777edb97e
regexp: revert "use sync.Pool to cache regexp.machine objects"

Revert CL 101715.

The size of a sync.Pool scales linearly with GOMAXPROCS,
making it inappropriate to put a sync.Pool in any individually
allocated object, as the sync.Pool documentation explains.
The change also broke DeepEqual on regexps.

I have a cleaner way to do this with global sync.Pools but it's
too late in the cycle. Will revisit in Go 1.12. For now, revert.

Fixes #26219.

Change-Id: Ie632e709eb3caf489d85efceac0e4b130ec2019f
Reviewed-on: https://go-review.googlesource.com/122596
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/regexp/regexp.go