protocolbuffers/protobuf
View on GitHub ↗ ★ 72,148 C++
Protocol Buffers - Google's data interchange format
124 mentions on Hacker News by 89 people: 11 stories, 113 comments · first 2014-12-15 · latest 2026-10-09
20082026
-
…that these APIs are necessary to implement the weak-valued caches we've always used in the past: https://github.com/protocolbuffers/protobuf/blob/6559a9f9622...
comment by haberman · 2026-10-09 · in Python 3.15 -
https://github.com/protocolbuffers/protobuf/commit/50f9ac3ba... On a sufficiently anemic CPU doing enough fast allocation you can get measurable improvements from that kind of thing, but for a superscalar CPU and a general purpose…
comment by charleslmunger · 2026-09-18 · in Size-Specialized Memory Allocation -
…is deprecated anyway [2]? (I think this is roughly where I got to before when I gave up.) [1] https://github.com/protocolbuffers/protobuf/blob/main/python... [2] https://github.com/protocolbuffers/protobuf/issues/9464
comment by quietbritishjim · 2026-07-13 · in Protobuf-py: Protobuf for Python, without compromises -
…compiler, but you can control its behavior more reliably with __builtin_expect_with_probability https://github.com/protocolbuffers/protobuf/commit/9f29f02a3...
comment by charleslmunger · 2026-07-05 · in Trust your compiler: Modern C++ -
I've spent some brainpower on binary search and have not been able to beat this: https://github.com/protocolbuffers/protobuf/blob/44025909eb7... 1. Check for dense list O(1) 2. Check upper bound 3. Constant trip count binary search The…
comment by charleslmunger · 2026-04-30 · in You can beat the binary search -
You're saying we choose Protobufs [1] because Google maintains it but not FlatBuffers [2]? [1] - https://github.com/protocolbuffers/protobuf : Google's data interchange format [2] - https://github.com/google/flatbuffers : Also maintained…
comment by nindalf · 2026-01-23 · in Replacing Protobuf with Rust -
…chains, no weirdly looking code - everything just works. You can see real life example here: https://github.com/protocolbuffers/protobuf/blob/bd7fe97e8c1... Again, even inside Google there were docs that considered those macroses bad and…
comment by galkk · 2026-01-06 · in Monads in C# (Part 2): Result -
…path is still available if the application owner set a flag to turn it back on if they want to: https://github.com/protocolbuffers/protobuf/issues/20760 Java Protobuf also logs a warning now if you can tell you are using gencode old enough…
comment by esrauch · 2025-12-20 · in Log level 'error' should mean that something needs to be fixed -
…of conditional moves (usually inserting them) with __builtin_expect_with_probability(..., 0.5) https://github.com/protocolbuffers/protobuf/commit/9f29f02a3...
comment by charleslmunger · 2025-11-02 · in When O3 is 2x slower than O2 -
…arguments without costing extra lines of code. The library I had in mind is Google's RPC callbacks: https://github.com/protocolbuffers/protobuf/blob/main/src/go... This library was written in the C++98 era. It might seem silly now because…
comment by omoikane · 2025-09-30 · in `std::flip` -
…can’t be used as a map key. I filed an issue requesting this and it was denied with an explanation: https://github.com/protocolbuffers/protobuf/issues/7791#issu...
comment by sgammon · 2025-09-06 · in Protobuffers Are Wrong (2018) -
Out of curiosity, does this idiom work in fil-c? https://github.com/protocolbuffers/protobuf/blob/cb873c8987d... // This somewhat silly looking add-and-subtract behavior provides provenance // from the original input buffer's pointer.…
comment by charleslmunger · 2025-09-05 · in Fil's Unbelievable Garbage Collector -
…table taking advantage of arm's fixed instruction width to calculate the jump target with a shift. https://github.com/protocolbuffers/protobuf/commit/b039dfe26... This results in one branch for 1 byte varints, plus one additional branch…
comment by charleslmunger · 2025-07-25 · in I wasted weeks hand optimizing assembly because I benchmarked on random data -
…in C++ used to check for the expected next field before falling back to the switch() (example here: https://github.com/protocolbuffers/protobuf/blob/460e7dd7c47... ) but this was removed in 2016 when load tests found that it hurt more than…
comment by haberman · 2025-07-23 · in Parsing Protobuf like never before -
…use the schema's field numbers as the case labels. You can see an example of that here (in C++): https://github.com/protocolbuffers/protobuf/blob/f763a2a8608... More recently, we've moved towards making Protobuf parsing more data-driven,…
comment by haberman · 2025-07-23 · in Parsing Protobuf like never before -
I wrote a portable abstraction for this that works across Linux, MacOS, and Windows: https://github.com/protocolbuffers/protobuf/blob/4917ec250d3... I call them "linker arrays". They are great when you need to globally register a set of…
comment by haberman · 2025-07-19 · in C++: Zero-cost static initialization -
…for the purposes I needed. [0]: https://github.com/keith-bennett-airmap/grpc-stacksmash [1]: https://github.com/protocolbuffers/protobuf/issues/12732 > I can see various fuzzers in the code base so that claim is also unsubstantiated…
comment by inetknght · 2025-07-13 · in Show HN: BinaryRPC – Lightweight WebSocket-based RPC framework in modern C++ -
This is doable via this trick: https://github.com/protocolbuffers/protobuf/blob/ae0129fcd01...
comment by charleslmunger · 2025-07-01 · in The provenance memory model for C -
…it's unreasonable for us to ask our users to not be able to use the official Protobuf library). 0 - https://github.com/protocolbuffers/protobuf/issues/19321
comment by kodablah · 2025-03-25 · in Ruby, Ractors, and lock-free data structures -
…unless something has changed recently. Goes to show that even the behemoths can get this wrong. https://github.com/protocolbuffers/protobuf/blob/6aefdde9736...
comment by chrome111 · 2025-03-16 · in Sign in as anyone: Bypassing SAML SSO authentication with parser differentials -
…Here's a few somewhat small, contained changes of mine, so we can talk about something concrete: https://github.com/protocolbuffers/protobuf/pull/19893/files This change alters a lock-free data structure to add a monotonicity invariant,…
comment by charleslmunger · 2025-02-17 · in The Big TDD Misunderstanding (2022) -
Best bet is likely https://github.com/protocolbuffers/protobuf/blob/main/docs/f... , which predates editions.
comment by akshayshah · 2024-12-17 · in Go Protobuf: The New Opaque API -
…to power other languages without a from-scratch implementation - and now powers python protos. https://github.com/protocolbuffers/protobuf/tree/main/upb
comment by charleslmunger · 2024-12-17 · in Go Protobuf: The New Opaque API -
…Edition 2023? The closest docs I've found are https://buf.build/blog/protobuf-editions-are-here and https://github.com/protocolbuffers/protobuf/tree/main/docs/d... .
comment by sa46 · 2024-12-16 · in Go Protobuf: The New Opaque API -
This optional field issue seems to have been fixed in 3.15 [0], and seems documented [1]. [0]: https://github.com/protocolbuffers/protobuf/releases/tag/v3.... [1]: https://protobuf.dev/programming-guides/proto3/#field-labels
comment by jiehong · 2024-09-16 · in Protocol Buffer Design: Principles and Practices for Collaborative Development -
…and MSVC support is WIP. [1] https://github.com/google/dawn/blob/40cf7fd7bc06f871fc5e4823... [2] https://github.com/protocolbuffers/protobuf/blob/c964e143d97... [3] https://github.com/facebook/react-native/blob/77b3a8bdd6164b... [4]…
comment by Calavar · 2024-09-07 · in What's new in C++26 (part 1) -
…for a project of its age, has several different varint parsing strategies. One is described at https://github.com/protocolbuffers/protobuf/blob/main/src/go... and another at https://github.com/protocolbuffers/protobuf/blob/main/src/go...
comment by jeffbee · 2024-08-11 · in Another variable-length integer encoding (2021) -
See protobuf field presence: https://github.com/protocolbuffers/protobuf/blob/main/docs/f...
comment by arccy · 2024-08-04 · in Parsing Protobuf Definitions with Tree-sitter -
…"The protocol compiler can output a FileDescriptorSet containing the .proto files it parses." ( https://github.com/protocolbuffers/protobuf/blob/main/src/go... ) I don't understand the point of using tree-sitter to repeat that work (almost…
comment by pcj-github · 2024-08-03 · in Parsing Protobuf Definitions with Tree-sitter -
It's because they changed the versioning format: https://github.com/protocolbuffers/protobuf/releases?page=5 / https://protobuf.dev/news/2022-05-06/ But I suppose old version still receive bugfixes.
comment by maeln · 2024-04-30 · in Hitting every branch on the way down -
Reminds me of https://github.com/protocolbuffers/protobuf/issues/1491 , which has effectively been WONTFIX (why does github not have this useful distinction?) because Google are happy with how it works and it's really difficult to make…
comment by pjc50 · 2024-04-30 · in Hitting every branch on the way down -
…pushing out a release of the other two that don't contain any changes would be pretty strange. [0]: https://github.com/protocolbuffers/protobuf/tags
comment by saghm · 2024-04-30 · in Hitting every branch on the way down -
…has had decent support for self-describing messages (very similar to avro) as well as reflection https://github.com/protocolbuffers/protobuf/blob/main/src/go... Xgooglers trying to make do on the cheap will just create a Union of all their…
comment by choppaface · 2024-03-10 · in Reverse Engineering Protobuf Definitions from Compiled Binaries -
…but I know of 2 standards for doing this: - SerializeDelimited* is part of the protobuf library: https://github.com/protocolbuffers/protobuf/blob/main/src/go... - Riegeli is "a file format for storing a sequence of string records,…
comment by NavinF · 2023-09-20 · in Add extra stuff to a “standard” encoding? Sure, why not -
It looks like Protobuf actually has a test suite to ensure compliance with the protocol: https://github.com/protocolbuffers/protobuf/tree/main/confor... Seems like a good idea for protocols in general to have an official test suite, as a…
comment by 0xDEAFBEAD · 2023-09-20 · in Add extra stuff to a “standard” encoding? Sure, why not -
…simple framing format [5], instead of claiming that protobuf has no obligation to define one. [1] https://github.com/protocolbuffers/protobuf/blob/main/docs/t... [2] https://github.com/tafia/quick-protobuf/issues/130 [3]…
comment by lifthrasiir · 2023-09-20 · in Add extra stuff to a “standard” encoding? Sure, why not -
…looking for bytes that are plausibly the beginning of a FileDescriptorProto message defined here: https://github.com/protocolbuffers/protobuf/blob/main/src/go... This takes advantage of the fact that such descriptors are commonly compiled…
comment by kentonv · 2023-08-27 · in Block YouTube ads on AppleTV by decrypting and stripping ads from Profobuf -
…discriminating zero value from unset value (aka options), they're back in proto3 (experimental) https://github.com/protocolbuffers/protobuf/blob/main/docs/i...
comment by ithkuil · 2023-07-22 · in How Turborepo is porting from Go to Rust -
On optional.. this was a regression in proto that is somewhat helped by https://github.com/protocolbuffers/protobuf/blob/main/docs/f... ; I have no idea whether protobuf for rust has started taking advantage of this. JSON is awful in every…
comment by foobiekr · 2023-07-21 · in How Turborepo is porting from Go to Rust -
recent versions of proto3 have added back the “optional” keyword that can be used on any field. see: https://github.com/protocolbuffers/protobuf/blob/main/docs/f...
comment by rvcdbn · 2023-07-21 · in How Turborepo is porting from Go to Rust -
I thought proto3 has support for optional scalar fields now ( https://github.com/protocolbuffers/protobuf/releases/tag/v3.... ), and proto2 always had it
comment by krackers · 2022-10-17 · in Never trust a system that seems to be working -
…appearing before and after the declaration which appear to be > attached to the declaration. https://github.com/protocolbuffers/protobuf/blob/v21.5/src/g... After re-reading with this caveat in mind -- that comments are only preserved…
comment by jhumphries131 · 2022-09-13 · in The Protobuf Language Specification -
It appears Google has released a spec as of 11 days ago: https://github.com/protocolbuffers/protobuf/issues/6188#issu...
comment by season2episode3 · 2022-09-12 · in The Protobuf Language Specification -
…since I wrote this so I don't remember exactly, but I think it's just an implementation quirk. See: https://github.com/protocolbuffers/protobuf/blob/main/src/go... The parser consumes a "-", then consumes a number. The number can be any…
comment by kentonv · 2022-09-12 · in The Protobuf Language Specification -
Google actually requested that the community contribute to a real specification. https://github.com/protocolbuffers/protobuf/issues/6188#issu... So we've taken the initiative. No rent-seeking.
comment by jhumphries131 · 2022-09-12 · in The Protobuf Language Specification -
…already has many language bindings, for example: - Protocol Buffer Third-party language bindings: https://github.com/protocolbuffers/protobuf/blob/master/docs... - Apache Thrift language support: https://github.com/apache/thrift/blob/master…
comment by minhmeoke · 2022-01-02 · in Ask HN: Who wants to collaborate? -
…[1] https://github.com/capnproto/capnproto/commit/eb8404a157e074... [2] https://github.com/protocolbuffers/protobuf/blob/master/CHAN...
comment by spenczar5 · 2021-11-20 · in Amazon Ion – A richly-typed, self-describing, hierarchical serialization format -
…"do not use" to prevent switch statements from assuming that an enum is complete and future-proof. https://github.com/protocolbuffers/protobuf/blob/master/src/...
comment by asdfasgasdgasdg · 2021-06-13 · in Did I break you? Reverse dependency verification -
…you've done a good job. Be wary of implementations that don't implement the conformance tests. [1]: https://github.com/protocolbuffers/protobuf/tree/master/conf... [2]: https://github.com/golang/go/blob/master/src/encoding/binary... [3]:…
comment by sa46 · 2021-06-03 · in A new ProtoBuf generator for Go -
…multiple repositories. The implementation being discussed there is the main C# implementation from https://github.com/protocolbuffers/protobuf/tree/master/csha...
comment by haberman · 2021-04-25 · in Parsing Protobuf at 2+GB/S: How I Learned to Love Tail Calls in C