protobuf-go/reflect/protoreflect
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
..
methods.go all: rename IsInitialized as CheckInitialized 2020-02-20 20:45:40 +00:00
proto_test.go reflect/protoreflect: optimize Name.IsValid and FullName.IsValid 2020-06-16 19:13:20 +00:00
proto.go reflect/protoreflect: optimize Name.IsValid and FullName.IsValid 2020-06-16 19:13:20 +00:00
source.go reflect/protoreflect: update documentation 2020-02-15 00:23:47 +00:00
type.go reflect/protoreflect: fix typo in FieldDescriptor.HasOptionalKeyword 2020-05-04 18:59:39 +00:00
value_pure.go all: change module to google.golang.org/protobuf 2019-05-14 17:28:29 +00:00
value_test.go
value_union.go reflect/protoreflect: adjust ValueOf panic message 2020-05-26 22:22:26 +00:00
value_unsafe.go all: change module to google.golang.org/protobuf 2019-05-14 17:28:29 +00:00
value.go reflect/protoreflect: cleanup wording on Message.NewField 2020-04-21 00:34:41 +00:00