is it worth re-implementing this client with protobuf.js?
instead of google-protobuf? I am seeing 1 in 10 requests suffering a considerable lag. Looking at protobuf.js, they seem to claim their implementation is more efficient than google-protobuf. the library however seems quite old so it's not clear if this still stands. is it worth re-implementing this client with protobuf.js?
I think it'd make sense to make it an option - but I think this might be the wrong repo? I think these changes would have to be made in https://github.com/improbable-eng/ts-protoc-gen. At the moment it expects to be generated into the same folder as the js_out output. I imagine it should be possible to add a variable that means it could assume to be used together with protobuf.js. What do you think?
I just wanted to test replacing the google-protobuf encoding and decoding with the protobufjs implementation. I managed to hack a POC. correct me if am wrong, but there would be no real difference in performance if we use the javascript objects generated by protobufjs instead of those generated by google-protobuf, right? the performance difference as, i understood, lies in the encodig /decoding process.
I think that's right, but we must obviously remain compatible with both (for backwards compatibility) if we're adding this.
I see. and agree. that said, would you have an idea where this lag could be coming from?
Nope - the frontend isn't really my area of expertise. Maybe do some profiling?
I want to have the ability of deserializeJson, but google-protobuf doesn't supply
so I'm interested in the protobuf.js version working with grpc-web.
Currently the biggest part of our bundle is the google-protobuf library.
protobuf.js is 73.2Kb, google-protobuf.js is 229.5Kb.
It would be very useful if there was a way to use protobuf.js as an alternative.
It would also make sense to do so because google-protobuf does not comply with unsafe-eval CSP, which makes it not possible to use out of the box in Web Extensions.
See: https://github.com/protocolbuffers/protobuf-javascript/issues/25