top | item 42238767

(no title)

james_promoted | 1 year ago

> Google open source libraries are often a mess when you try to include more than one of them in the same project

Completely agree. In isolation all of their libs are great, but inevitably I end up having to build Abseil from source, to then build Protobuf off of that, to then build gRPC off of that. If I can include the sanitizers under Google then that also becomes painful because Abseil (at least) will have ABI issues if it isn't built appropriately. Thinking about it I'd really just like a flat_hash_map replacement so I can drop Abseil.

discuss

order

Doctor_Fegg|1 year ago

Protobuf depending on Abseil (which has ongoing macOS build issues) is clinically insane. I tend to use protozero now which trades half a day’s boilerplate for two days’ build heartache.

https://github.com/mapbox/protozero

jeffbee|1 year ago

Wouldn't it be even more insane if protobuf had its own distinct string splitting/merging routines, its own flags and logging libraries, etc?

jcelerier|1 year ago

> Thinking about it I'd really just like a flat_hash_map replacement so I can drop Abseil.

boost has a flat_hash_map implementation for quite a few versions now, which from what I could see generally beat or is competitive with the absl implementation: https://www.reddit.com/r/cpp/comments/yikfi4/boost_181_will_...

vitus|1 year ago

The reddit thread mentions that the author was probably going to write a blog post about it at some point; I went and found it so you don't have to.

I was curious what exactly differentiates boost::unordered_flat_map from absl::flat_hash_map, and was not disappointed. It seems that the lion's share of the performance improvement comes from using more of the metadata for the reduced hash value, although there are a few other contributing factors.

The blog post further describes where absl::flat_hash_map performs better: iteration (and consequently erasure), which is ironic given those are a couple of areas where I always felt that absl::flat_hash_map was especially weak. But, it makes sense to double down on Abseil's strengths as well as its shortcomings.

https://bannalia.blogspot.com/2022/11/inside-boostunorderedf...

jeffbee|1 year ago

FWIW the flat hash map in Boost is now faster. I am not sure if integrating Boost is any easier for you.

james_promoted|1 year ago

I occasionally reconsider it so I can try a bunch of the FB alternatives (Folly, Thrift, CacheLib, etc.), but... yeah. Still just kind of waiting for a panacea.