Readit News logoReadit News
kelindar commented on Event – Fast, In-Process Event Dispatcher   github.com/kelindar/event... · Posted by u/kelindar
kelindar · 7 months ago
This might be useful to some if you need a very light pub/sub inside one process.

I was building a small multiplayer game in Go. Started with a channel fan-out but (for no particular reason) wanted to see if we can do better. Put together this tiny event bus to test, and on my i7-13700K it delivers events in 10-40ns, roughly 4-10x faster than the plain channel loop, depending on the configuration.

kelindar commented on Go library for in-process vector search and embeddings with llama.cpp   github.com/kelindar/searc... · Posted by u/kelindar
kelindar · a year ago
This library was created to provide an easy and efficient solution for embeddings and vector search, making it perfect for small to medium-scale projects that still need some vector search. It's built around a simple idea: if your dataset is small enough, you can achieve accurate results with brute-force techniques, and with some optimizations like SIMD, you can keep things fast and lean.
kelindar commented on Column – High-performance, columnar, in-memory store with bitmap indexing in Go   github.com/kelindar/colum... · Posted by u/ngaut
thunkshift1 · 5 years ago
Why the use of Go instead of something more traditional like c++, or even rust ? Isn’t it primarily used for infrastructure scripting and will affect performance of the db
kelindar · 5 years ago
Honestly, I enjoy programming in Go and been using it on a daily basis for the last few years. Most importantly, when it comes to performance it's often not the language that matters but how you structure your code. It's very much possible to build a terrible C++ program which thrashes memory and will be very slow. And I feel like Go is actually lacking those nice data-oriented libraries.
kelindar commented on Column – High-performance, columnar, in-memory store with bitmap indexing in Go   github.com/kelindar/colum... · Posted by u/ngaut
GeertJohan · 5 years ago
Really nice project! The transactions and replication streaming seem to make it a great choice for sharding/distributed environments!
kelindar · 5 years ago
That's the idea, a transaction commit log decoupled from underlying durable storage allows you to build your own persistence layers. I'm still thinking to build a simple (memory-mapped?) layer, but as an optional, separate lib.
kelindar commented on Column – High-performance, columnar, in-memory store with bitmap indexing in Go   github.com/kelindar/colum... · Posted by u/ngaut
ignoramous · 5 years ago
The same developer has an open-source entity-component-system, as well: https://github.com/kelindar/ecs
kelindar · 5 years ago
Wait no, that repo was an experiment that I'll be rebasing and finally building a real ECS based on the columnar storage library.
kelindar commented on Column – High-performance, columnar, in-memory store with bitmap indexing in Go   github.com/kelindar/colum... · Posted by u/ngaut
polskibus · 5 years ago
Great stuff, can it work with larger-than-memory datasets? Is there a way to limit resource consumption ? Or will process just blow up in such case?
kelindar · 5 years ago
It's actually possible, columns are simple Go interfaces and can be re-defined and defined for specific types. You can easily build implementation of columns that actually load data from disk or even a remote server (RDBMS, S3, ..?) and retain the indexing capability.

On the flip side, you could actually fit more data in-memory than with non-columnar methods, since the storage is column-by-column, it compresses very well. For example boolean values are stored as bitmaps in this implementation, strings could be stored in a hash map so there's only one string of a type that kept in memory, even if you have millions of rows.

u/kelindar

KarmaCake day134November 7, 2017View Original