Our great sponsors
-
Weaviate
Weaviate is an open-source vector database that stores both objects and vectors, allowing for the combination of vector search with structured filtering with the fault tolerance and scalability of a cloud-native database.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
For example, take this loop in a dot product function which we had to write in Assembly because what the Go compiler produced wasn't fast enough. The reason it's in assembly is because we can use AVX FMA instructions, but notice how the loop is unrolled 4 times. This unrolling actually brought about as much performance gain as the AVX instructions itself. From what I understand the compiler also does unrolling on regular Go for loops. So, if the additional functional call would prevent the unrolling, this could be a quite noticeable performance penalty.
I still believe that Go is better served by a handful of new builtins, plus ergonomics lambdas, than full-blown user-defined generics. In particular, adding map/filter as builtins would allow for deep compiler optimization. In Ply I was able to transform chains like xs.morph(square).filter(even) into a single for loop with no intermediate slice allocations.
From https://github.com/robpike/filter:
Related posts
- Optimizing Go string operations with practical examples
- Introducing Weaviate, a fast modular vector search engine with out of the box support for state-of-the-art ML models written in Go
- Building a Playful File Locker with GoFr
- Fastest way to get IPv4 address from string
- We now have crypto/rand back ends that ~never fail