]> Sergey Matveev's repositories - public-inbox.git/commit
xapcmd: reduce CPU idling when shards exceeds job count
authorEric Wong <e@yhbt.net>
Wed, 12 Aug 2020 09:17:16 +0000 (09:17 +0000)
committerEric Wong <e@yhbt.net>
Thu, 13 Aug 2020 02:22:57 +0000 (02:22 +0000)
commiteace79f62e5cab2ecaf05d4e8773ab99f7662f48
tree2ab81db76f8dfaf9b94e106559169b5568fde412
parenta3aebf796f9b06a04ebb6156240b74b6cc53fdb8
xapcmd: reduce CPU idling when shards exceeds job count

In case there's unbalanced shards AND we're limiting parallelism
while using many shards, spawn the next task in the queue ASAP
once a task is done, instead of waiting for all tasks to finish
before spawning the next batch.

Unbalanced shards probably isn't a big issue for most users;
however many smaller shards with few jobs can be useful for HDD
users to reduce the effect of random writes.
lib/PublicInbox/Xapcmd.pm