Java – linkedblockingqueue and primitives
I need a linkedblockingqueue, but I pass the primitive to it The data rate added to the queue is about 4 milliseconds or 256 data points per second The problem I encountered was that the data began to delay immediately at the beginning, but over time, it seemed that JIT made it more effective and ended in real time I try to figure out where I need to reduce the initial delay. One is to "float" floating objects by auto boxing in each insert in the queue Does anyone use the linkedblockingqueue of primitives?
Or is there something faster than linkedblockingqueue when you're not sure about the size and use primitives?
Solution
Although your data is not large enough to ensure better data structure, fastutil library is exactly what you need It has fast collection speed, low memory consumption, and each Java primitive has a version
They have no blocking implementations, but you should be able to extend their classes to add their functionality