diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-11-28 17:24:00 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-11-28 17:24:00 -0800 |
commit | 48fc9c6b03ac1024e330b1159fefbcbe9ad79740 (patch) | |
tree | 5fd539c0b297534abcad4c06e3785ec3e67f7f0d /src/framework.js | |
parent | 74373c27a599c6fe0d5fb101a476e66cc3c502bb (diff) |
allow more GCing inside our big compiler loops
Diffstat (limited to 'src/framework.js')
-rw-r--r-- | src/framework.js | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/framework.js b/src/framework.js index 8e65699d..495d0167 100644 --- a/src/framework.js +++ b/src/framework.js @@ -150,16 +150,13 @@ Substrate.prototype = { that.checkInbox(actor); if (actor.items.length == 0) return; - var inputs = actor.items.slice(0); + var inputs = actor.items; var outputs; var currResultCount = that.results.length; dprint('framework', 'Processing using ' + actor.name_ + ': ' + inputs.length); - actor.items = []; // More may be added in process(); we'll get to them next time - //var t = Date.now(); + actor.items = []; outputs = actor.process(inputs); if (DEBUG_MEMORY) MemoryDebugger.tick('actor ' + actor.name_); - //t = (Date.now()-t)/1000; - //dprint('framework', 'Took ' + t + ' seconds.'); dprint('framework', 'New results: ' + (outputs.length + that.results.length - currResultCount) + ' out of ' + (that.results.length + outputs.length)); hadProcessing = true; @@ -215,6 +212,7 @@ Actor.prototype = { var ret = []; for (var i = 0; i < items.length; i++) { var item = items[i]; + items[i] = null; // items may be very very large. Allow GCing to occur in the loop by releasing refs here dprint('frameworkLines', 'Processing item for llvm line ' + item.lineNum); Framework.currItem = item; var outputs = this.processItem(item); |