-
Notifications
You must be signed in to change notification settings - Fork 374
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/encoding/text/decode: stop using regexp
This eliminates the last user of the regexp package, which should save about 130K from the resulting stripped binary importing this package (unless, of course, regexp is brought in directly of via another dependency). Added some new cases to TestDecoder to test the new function. Benchmark (not included) shows the following results, comparing to old implementation using regexp.Find: name old time/op new time/op delta ErrId-4 1.93µs ± 1% 0.21µs ± 1% -89.20% (p=0.002 n=6+6) name old alloc/op new alloc/op delta ErrId-4 128B ± 0% 0B -100.00% (p=0.002 n=6+6) name old allocs/op new allocs/op delta ErrId-4 13.0 ± 0% 0.0 -100.00% (p=0.002 n=6+6) Change-Id: I5569a47580f41cc60f92c444e8d43bb3f26faa4e Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/402774 Reviewed-by: Cassondra Foesch <cfoesch@gmail.com> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Lasse Folger <lassefolger@google.com>
- Loading branch information
Showing
2 changed files
with
45 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters