sbtourist / Journal.IO

Journal.IO is a zero-dependency, fast and easy-to-use journal storage implementation.
Apache License 2.0
260 stars 39 forks source link

Read performance improvements. #49

Closed sbtourist closed 10 years ago

sbtourist commented 10 years ago

1) When reading locations, there's no need to check on disk if the start location is contained among inflight writes but the next one isn't, because locations are batched sequentially.

2) When end-of-batch/end-of-file is reached, there's no need to keep looking for the next location if the next file position doesn't contain an header.

3) Record headers should be read in block.

sbtourist commented 10 years ago

Performance improvements of up to 40%, measured via ReadPerformanceTest#testSequentialRead which went from ~10 secs to ~6 secs.