During investigation of slow queries on server with big amount of files I found out that main culprit was on fetchData - it's doing data fetch serially, which is slow on hundreds and thousands of files. Main bottleneck should be disk, but we're doing some realtime merging with cache. We can speed up fetchData with goroutines, with sane cap (2 x GOMAXPROCS).
Also contains queryCache to expireCache struct renaming, as TODO asked.
During investigation of slow queries on server with big amount of files I found out that main culprit was on
fetchData
- it's doing data fetch serially, which is slow on hundreds and thousands of files. Main bottleneck should be disk, but we're doing some realtime merging with cache. We can speed upfetchData
with goroutines, with sane cap (2 x GOMAXPROCS). Also containsqueryCache
toexpireCache
struct renaming, as TODO asked.