@sasuke___420@DanielW_Kiwi@htmx_org Yeah, I realised what you meant after I already replied
I thought that you were talking about how repeated used to work without [packed=true] back in the days and the fact that strings are validated for UTF8 at parsing
@sasuke___420@DanielW_Kiwi@htmx_org Repeated fields should be fine as long as you have fixed-width primitives
Proto packs them, so you get just the length of the payload followed by values
And you can replace strings with bytes if you really want
@sasuke___420@DanielW_Kiwi@htmx_org I'd also expect simdjson to be significantly more optimised than whatever proto is doing
With an equivalent parser, proto would probably get notably faster
And it would be easier to write an efficient schema too
You can avoid varints, but not doubles
@sasuke___420@DanielW_Kiwi@htmx_org It's not really apples-to-apples, but proto reached over 2GB/s on benchmarks ~5 years ago and, according to the author, JSON would need 5,1GB/s to match it because of the bigger size of the payload
https://t.co/rXhAR7CNly
And that's with a lot of varints, so not much sims
@sasuke___420@DanielW_Kiwi@htmx_org Unless you create a schema that requires a lot of heap allocs, don't pack a repeated field in proto2, or use some weird lib, the slower parsing just doesn't make sense to me, so Iโm curious what caused them
@sasuke___420@DanielW_Kiwi@htmx_org Do you have a link to these benchmarks?
A quick Google search returns only benchmarks where proto is equal to or faster than JSON and it kinda matches internal benchmarks my company did (it was some thing me ago though)
Even with varints, this is JSON we're talking about
@sasuke___420@DanielW_Kiwi@htmx_org Google uses it for everything and there is a lot of empirical evidence from other companies too
https://t.co/7A6tzB2Ose
https://t.co/YfjnHb3C7f
@sasuke___420@DanielW_Kiwi@htmx_org You don't need to use varints, proto has fixed-size integer types
There are some footguns that can kill your performance, but I don't see how proto is not inherently faster than JSON
@DanielW_Kiwi@sasuke___420@htmx_org Isnโt it primarily because JSON parsers are better optimised than their proto equivalents?
And โJSON can be faster in some situationsโ != โprotobuf is not more efficient formatโ
@sasuke___420@DanielW_Kiwi@htmx_org Could you expand on that? I donโt see how protobuf is not more efficient than a format where every digit requires a separate byte
@teortaxesTex Having capex on the level of hyperscalers when you have zero ways to monetize it in any real way seems insane
The only way I can rationalize it is that they just want to start a capex/opex war. Meta may be dysfunctional but they have more $ and conviction than anyone else.
@sasuke___420@croloris Yeah, you'll color your functions by passing the same IO object everywhere, but it make sense because it's imo more consistent with "the zig way of doing things" than introducing the async keyword or making it some magical global variable
@sasuke___420@croloris > passing a runtime object representing the blob of syscalls one will use doesn't make much sense
could you expand on that? zig already does that with allocators, right?
@pskocik@joseph_h_garvin Thanks for the link. Does it actually have a tangible impact on performance?
Instructions take more space in the cache, but I'd assume that the access pattern for fetching them is rather sequential, so prefetching should help a lot + the hot path is almost always in cache anyway