Comments (6)
Tape wasn't designed to be super high throughout; it was designed to be simple and safe.
If you want to ramp up throughput, encode items in batches. It's a more complicated API but you'll save fsync calls which dominates performance.
from tape.
I retract my question. I did not realize that pick()/iterate does not keep its own position in the queue - always start from head which is only advanced by remove. So it looks like in a multi-threaded environment there is no way to read from queue process data and remove of successful except keeping the lock for entire period from starting iteration to end of processing and removal. So if consumer for some reason stuck producers will not be able to put anything on the queue till the consumer released the lock.
I guess in case of a single consumer and multiple producers I still could lock, peek, unlock, process then lock and remove assuming the only one consumer performing any remove operation
from tape.
from tape.
Thanks @JakeWharton I have switched to a single consumer for the queue with fork/join multiple parallel processors and then removal from the queue when all processors are done.
I am curious what performance to expect on adding small items (20 bytes). For me it is pretty slow - about 1500 items/sec on fast machine with SSD. I can pump date to a remote database faster. I tried to turn antivirus off but does not seem to make much difference. What is your typical insertion rate with small items?
from tape.
thank you @swankjesse I was thinking about it but adding does not lend itself to batching in my case - the whole point is to put it on a persistent queue immediately for reliability not to accumulate it in memory. As far as reading I do drain whole the queue and then remove all drained items at once but to avoid extra fsync but iteration I think reads records one by one. I do not know if there is anything else I can do beyond bulk removal.
I really liked Tape when I found it and would prefer not to roll my own solution although my case is simpler - I just need ability to recover queue on crash/restart and dumping overflow data if consumer is not available. I could do with an in memory queue backed up by append-only fixed record size file with head index that is moved on every N-th peek because I can tolerate replaying already processed transactions. Given all that I think I can make it good deal faster but it'll still have many corner cases to worry about and test...
from tape.
sorry, the last question - when 2.0 release is to be expected? I am using snapshot maven but would prefer a release if possible
from tape.
Related Issues (20)
- Is it thread safe? HOT 3
- Android module for android specific logic HOT 2
- A question about the evolution of this repository HOT 1
- Read/Write Benchmarks HOT 1
- Application not responding after adding an entry to the queue HOT 2
- Remove java.io.OutputStream and the like from API?
- BlockingQueue implementation and other interfaces HOT 5
- Wrap QueueFile around an existing File? HOT 6
- Support addAll(Collection<byte[]>) for better performance with small records HOT 2
- Windows non-sync writes HOT 1
- Fail to read queue.
- Leak of file descriptor when creating QueueFile from corrupted queue file. HOT 1
- Not compatible with Gradle 5.1.1 HOT 6
- Why so slow?
- QueueFileTest.testSaturatedFileExpansionMovesElements hanged HOT 3
- Issues while writing and reading from different daemons with flock
- Consider DequeFile HOT 1
- Fail to Remove from FileObjectQueue
- Time to mark as deprecated? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tape.