Skip to content

Commit

Permalink
Decrease batcher wait time to speed up startup
Browse files Browse the repository at this point in the history
  • Loading branch information
indutny-signal authored and josh-signal committed Mar 31, 2021
1 parent 6f7ecb1 commit 5c8cb6b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions ts/textsecure/MessageReceiver.ts
Expand Up @@ -205,7 +205,7 @@ class MessageReceiverInner extends EventTarget {

this.cacheAddBatcher = createBatcher<CacheAddItemType>({
name: 'MessageReceiver.cacheAddBatcher',
wait: 200,
wait: 75,
maxSize: 30,
processBatch: (items: Array<CacheAddItemType>) => {
// Not returning the promise here because we don't want to stall
Expand All @@ -215,13 +215,13 @@ class MessageReceiverInner extends EventTarget {
});
this.cacheUpdateBatcher = createBatcher<CacheUpdateItemType>({
name: 'MessageReceiver.cacheUpdateBatcher',
wait: 500,
wait: 75,
maxSize: 30,
processBatch: this.cacheUpdateBatch.bind(this),
});
this.cacheRemoveBatcher = createBatcher<string>({
name: 'MessageReceiver.cacheRemoveBatcher',
wait: 500,
wait: 75,
maxSize: 30,
processBatch: this.cacheRemoveBatch.bind(this),
});
Expand Down
4 changes: 2 additions & 2 deletions ts/util/messageBatcher.ts
Expand Up @@ -7,7 +7,7 @@ import { createWaitBatcher } from './waitBatcher';

const updateMessageBatcher = createBatcher<MessageAttributesType>({
name: 'messageBatcher.updateMessageBatcher',
wait: 500,
wait: 75,
maxSize: 50,
processBatch: async (messageAttrs: Array<MessageAttributesType>) => {
window.log.info('updateMessageBatcher', messageAttrs.length);
Expand All @@ -33,7 +33,7 @@ export function setBatchingStrategy(keepBatching = false): void {

export const saveNewMessageBatcher = createWaitBatcher<MessageAttributesType>({
name: 'messageBatcher.saveNewMessageBatcher',
wait: 500,
wait: 75,
maxSize: 30,
processBatch: async (messageAttrs: Array<MessageAttributesType>) => {
window.log.info('saveNewMessageBatcher', messageAttrs.length);
Expand Down

0 comments on commit 5c8cb6b

Please sign in to comment.