Commit Graph

3 Commits

Author SHA1 Message Date
Steven Allen
9de031b432 preallocate Batch's blocks buffer on commit.
It's probably safe to assume that this buffer will be about the same time each
flush.

This could cause 1 extra allocation (if this is the last commit) but that's
unlikely to be an issue.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-10-11 11:43:30 -07:00
Steven Allen
e41848c537 create an issue for tuning the parallelism constant
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-10-11 11:40:54 -07:00
Steven Allen
09136e931b parallelize batch flushing
1. Modern storage devices (i.e., SSDs) tend to be highly parallel.
2. Allows us to read and write at the same time (avoids pausing while flushing).

fixes https://github.com/ipfs/go-ipfs/issues/898#issuecomment-331849064

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-10-10 19:38:27 -07:00