You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TennyZhuang
changed the title
(gogoproto.stdtime) = true cause low marshal performance(gogoproto.stdtime) = true causes low marshal performance
Jan 9, 2020
gogo/protobuf/types
.Timestamp is generated byprotoc-gen-gogo
and importsgogo/protobuf/proto
.To avoid cycling import, gogo/protobuf implement a fake
timestamp
.protobuf/proto/timestamp_gogo.go
Lines 38 to 46 in 5628607
And it does not implement
newMarshaler
orMarshaler
interface, which will cause theMarshal
use the slowest path.protobuf/proto/table_marshal.go
Lines 2951 to 2954 in 5628607
Then the global marshal info lock will be performance bottleneck.
protobuf/proto/table_marshal.go
Lines 107 to 116 in 5628607
A simple workaround fix is #655
A better solution is use a real Timestamp instead of a fake timestamp.
To avoid cycling import, we can import golang/protobuf and use Timestamp generated by golang protobuf.
Then the performance will be highly improved.
The text was updated successfully, but these errors were encountered: