diff options
author | Joey Hess <joey@kitenet.net> | 2013-04-24 16:40:35 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-04-24 16:40:35 -0400 |
commit | 18d105ac970e42976ec00aca495ad31ea33d818f (patch) | |
tree | 730ae90cc6f1b19ba4a29e4447a3477a4d5f8781 /Assistant/Threads | |
parent | 5244ab7656e2269676cf6296718c8e5243c5b919 (diff) |
batch commit every 5 thousand changes, not 10 thousand
There's a tradeoff between making less frequent commits, and
needing to use memory to store all the changes that are coming
in. At 10 thousand, it needs 150 mb of memory. 5 thousand drops
that down to 90 mb or so.
This also turns out to have significant imact on total run time.
I benchmarked 10k changes taking 27 minutes. But two 5k batches
took only 21 minutes.
Diffstat (limited to 'Assistant/Threads')
-rw-r--r-- | Assistant/Threads/Committer.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Assistant/Threads/Committer.hs b/Assistant/Threads/Committer.hs index ea3f01fc5..17eefd3f5 100644 --- a/Assistant/Threads/Committer.hs +++ b/Assistant/Threads/Committer.hs @@ -140,7 +140,7 @@ humanImperceptibleDelay = threadDelay $ shouldCommit :: UTCTime -> [Change] -> Bool shouldCommit now changes | len == 0 = False - | len > 10000 = True -- avoid bloating queue too much + | len > 5000 = True -- avoid bloating change pool too much | length recentchanges < 10 = True | otherwise = False -- batch activity where |