LinkedBlockingQueue and primitives

I need a LinkedBlockingQueue, but I pass the primitives to it. My data rates for adding to the queue are about 4 ms or 256 data points per second. The problem I ran into is that the data starts to linger immediately upon startup, but over time it seems that JIT makes it more efficient and ends in real time. I am trying to figure out where I need to reduce the initial delay, and one of them is the โ€œnewโ€ Float object from autoboxing for each insert in the queue. Does anyone have a LinkedBlockingQueue using primitives?

Or is there something faster than LinkedBlockingQueue when you are unsure of the size and use of primitives?

+4
source share
1 answer

Although your data is not large enough to guarantee the best data structures, the Fastutil library is exactly what you are looking for. These are collections that take up fast and low memory space, and they have versions for each Java primitive.

They do not have implementations for locking, but you must extend their classes to add their functionality.

+1
source

All Articles