Agrona
| JCTools | Agrona | |
|---|---|---|
| 3 | 7 | |
| 3,847 | 3,205 | |
| 0.6% | 0.7% | |
| 7.9 | 9.3 | |
| 8 days ago | 4 days ago | |
| Java | Java | |
| Apache License 2.0 | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
JCTools
- Crossfire: High-performance lockless spsc/mpsc/mpmc channels for Rust
-
if you had to restart at 0 knowledge what would you do?
Install some tool that would help you see the performance of your system, like a graph of the CPU usage, the top processes being used, disk activity/read/write, etc. Every time you run your program, glance at those numbers, eventually you'll develop an intuition. Basically write code and profile. A good exercise would be practicing with data structures, this site has an exhaustive list of them, find some stuff that's interesting then google the implementation, then build it yourself, test it, debug, profile, optimize, and understand the performance constraints. Eventually you'll develop better understanding and can compare between other people's works, optimizing them. If you want to go beyond, read some papers on lock-free algorithms https://github.com/JCTools/JCTools/tree/master/resources then read Brendan Gregg's blog and books. Read about how profiling tools work https://github.com/andikleen/pmu-tools/wiki/toplev-manual
-
What do implementations that use Unsafe do to be able to compile?
If I fork this implementation's repo and then publish a release (of the forked version) with my own commits via jitpack.io (committing with Android Studio IDE).
Agrona
-
100 hour gap between a vibecoded prototype and a working product
In some places I'm using https://github.com/aeron-io/agrona
Strangely this is one of the areas where I want to use project panama so I might re-implement some of the ring buffers constructs.
You allocate off heap memory and dump data into it. With modern Java classes like Arena, MemoryLayout, and VarHandle it's honestly a lot like C structs.
I answered "why" in another post in this thread.
-
Go Primitive in Java, or Go in a Box
Thanks, I've mostly used fastutil lately because it seems to be best maintained. I'll have to look at carrotlabs though, I like the approach of a clean break with java.util.collections.*.
The Agrona Java library from the Aeron people has some primitive optimized collections too: https://github.com/aeron-io/agrona
-
Any library you would like to recommend to others as it helps you a lot? For me, mapstruct is one of them. Hopefully I would hear some other nice libraries I never try.
Aeron for low latency apps and Agrona is you're using Aeron for data structures
-
Need help navigating the Java ecosystem (coming from C++)
Martin Thompson is one of the leaders in that space: his blog is a really great place to start. His Agrona library is a bunch of high-performance data structures, which you can use directly, but which can also serve as examples of writing such code.
-
WritableImage and real-time ray-tracing. I need help!
ByteBuffer methods have quite a bit of overhead. You could further try to (1) writing to a byte[] first and then using the put(byte[]) method, or (2) use sun.misc.Unsafe::putByte (maybe try with Agrona's DirectBuffer and copy the necessary lines if need be).
- Are you interested in learning about low latency zero allocation programming?
What are some alternatives?
Disruptor - High Performance Inter-Thread Messaging Library
Koloboke - Java Collections till the last breadcrumb of memory and performance
Eclipse Collections - Eclipse Collections is a collections framework for Java with optimized data structures and a rich, functional and fluent API.
fastutil - fastutil extends the Java™ Collections Framework by providing type-specific maps, sets, lists and queues.