Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

JSON is easier (faster) to parse on their client apps.


If you are building a new app, I'd really suggest checking out gRPC:

http://www.grpc.io/

The combination of an HTTP/2 stack w/ protocol buffers and libraries in everything you'd write a mobile app in is a powerful combo, and its a pretty high development velocity environment.


Just finished a fairly large pilot test with grpc. Summary: it's not production ready. It seems to be still moving rapidly and bugs pop up. I'd recommend holding back for awhile longer.

Also, instagram heavily relies on JS. There are not any protobuf parsers in js that perform anywhere near that of native json. The most feature complete implementation is two orders of magnitude slower.

Using the C++ bindings is faster, but is more difficult to fit into a typical build, can't work in a browser, and still an order of magnitude slower.

It's definitely something to keep an eye on, but, IMHO, not quite ready for something large scale.


How does it compare to flatbuffers [1]? Facebook apparently uses it, but their usage is from java [2].

[1] https://google.github.io/flatbuffers/ [2] https://code.facebook.com/posts/872547912839369/improving-fa...


gRPC is great, but Instagram's client apps are web-based (using React now), and consuming protobuf in JavaScript is unlikely to be faster (and definitely not as convenient) vs. JSON.

Given the limited resources of a lot of Android devices, an extra unmarshalling step would offset any wire-size reductions.


Just to clarify, do you mean that all of their mobile apps are on react-native now? Or just their web apps?


Extra unmarshaling? The string will either be parsed as JSON or some other thing.


Have you actually measured that? I've used a couple of different JSON libraries on Android and also some of the binary formats. In general the binary formats are more performant.

I definitely agree with you that JSON is easier to work with, but at the scale of Instagram I don't think that would be an issue.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: