protobuf-go/reflect
Joe Tsai 44e4150b30 reflect/protoreflect: optimize Name.IsValid and FullName.IsValid
For simplicity, IsValid was implemented in terms of regular expressions,
which are useful for verifying a string according to a strict grammar,
but performs poorly. Implement the check in terms of hand-written code,
which provides a 20x improvement to validate the name "google.protobuf.Any".

name               old time/op  new time/op  delta
FullNameIsValid-8   683ns ± 2%    35ns ± 1%  -94.86%  (p=0.000 n=10+10)

Change-Id: I980403befca0b72cea22acd274064a46cb02644b
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/238002
Reviewed-by: Damien Neil <dneil@google.com>
2020-06-16 19:13:20 +00:00
..
protodesc internal/genid: add new package for generated identifiers 2020-05-29 07:08:23 +00:00
protoreflect reflect/protoreflect: optimize Name.IsValid and FullName.IsValid 2020-06-16 19:13:20 +00:00
protoregistry all: add weak dependency on google.golang.org/genproto module 2020-05-26 22:06:12 +00:00