Bug 1362786 - (1) Increase subprocess BUFFER_SIZE r?kmag draft
authorDoug Thayer <dothayer@mozilla.com>
Fri, 21 Jul 2017 10:20:36 -0700
changeset 613392 7887b6c125788c017e8d8373cb42b105f0e81d38
parent 612315 d3ebc6448a62d38b134e957eb4fd5c2565ad40b8
child 613393 e1f1be5e49efedf1e78a5813af8d8789774deb08
push id69780
push userbmo:dothayer@mozilla.com
push dateFri, 21 Jul 2017 21:21:35 +0000
reviewerskmag
bugs1362786
milestone56.0a1
Bug 1362786 - (1) Increase subprocess BUFFER_SIZE r?kmag While 4KiB is a decently sized buffer, bumping it to 32 on my machine reduced the time for getSymbolsFromNM from 12s to 8s. If 32 is too large for the typical use of this, then we can instead just parameterize this so that we can specify as large a buffer as we want for our use case. MozReview-Commit-ID: 3wGpHzQ9uZ5
toolkit/modules/subprocess/subprocess_common.jsm
--- a/toolkit/modules/subprocess/subprocess_common.jsm
+++ b/toolkit/modules/subprocess/subprocess_common.jsm
@@ -20,17 +20,17 @@ XPCOMUtils.defineLazyModuleGetter(this, 
 XPCOMUtils.defineLazyModuleGetter(this, "setTimeout",
                                   "resource://gre/modules/Timer.jsm");
 
 Services.scriptloader.loadSubScript("resource://gre/modules/subprocess/subprocess_shared.js", this);
 
 /* global SubprocessConstants */
 var EXPORTED_SYMBOLS = ["BaseProcess", "PromiseWorker", "SubprocessConstants"];
 
-const BUFFER_SIZE = 4096;
+const BUFFER_SIZE = 32768;
 
 let nextResponseId = 0;
 
 /**
  * Wraps a ChromeWorker so that messages sent to it return a promise which
  * resolves when the message has been received and the operation it triggers is
  * complete.
  */