=rem #16428 optimize protobuf serializer for master

#16428 for master
@patriknw yes,But in our QQ group some guys said that should not using ```Option``` to only match ```Some``` & ```None```,and the code I paste up ,Is really some guys' idea.I like the ```match```,but them said ,that not that pure and ```functional```.