aboutsummaryrefslogtreecommitdiff
path: root/src/enzymatic.js
diff options
context:
space:
mode:
authorAlon Zakai <azakai@mozilla.com>2010-11-14 14:06:13 -0800
committerAlon Zakai <azakai@mozilla.com>2010-11-14 14:06:13 -0800
commit19a8ebc69fc7f0eb1e31f133637c769e18a44929 (patch)
tree100b59968187e56e82666a37fba4e81c7921d5cc /src/enzymatic.js
parent9a47a5d9b3d98c5c029ca6043f967c55ddf70efb (diff)
parse each function in a separate pass, to save RAM
Diffstat (limited to 'src/enzymatic.js')
-rw-r--r--src/enzymatic.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/enzymatic.js b/src/enzymatic.js
index e6af4ab5..b0fd4619 100644
--- a/src/enzymatic.js
+++ b/src/enzymatic.js
@@ -56,7 +56,7 @@ Substrate.prototype = {
},
solve: function() {
- print("// Solving " + this.name_ + "...");
+ dprint('enzymatic', "// Solving " + this.name_ + "...");
var startTime = Date.now();
var midTime = startTime;
@@ -64,12 +64,12 @@ Substrate.prototype = {
function midComment(force) {
var curr = Date.now();
if (curr - midTime > 1000 || force) {
- print('// Working on ' + that.name_ + ', so far ' + ((curr-startTime)/1000).toString().substr(0,10) + ' seconds.');
+ dprint('enzymatic', '// Working on ' + that.name_ + ', so far ' + ((curr-startTime)/1000).toString().substr(0,10) + ' seconds.');
midTime = curr;
}
}
function finalComment() {
- print('// Completed ' + that.name_ + ' in ' + ((Date.now() - startTime)/1000).toString().substr(0,10) + ' seconds.');
+ dprint('enzymatic', '// Completed ' + that.name_ + ' in ' + ((Date.now() - startTime)/1000).toString().substr(0,10) + ' seconds.');
}
var finalResult = null;
@@ -89,10 +89,10 @@ Substrate.prototype = {
var outputs;
var currResultCount = that.results.length;
try {
- dprint('Processing using ' + zyme.name_ + ': ' + inputs.length);
+ dprint('enzymatic', 'Processing using ' + zyme.name_ + ': ' + inputs.length);
zyme.items = []; // More may be added in process(); we'll get to them next time
outputs = zyme.process(inputs);
- dprint('New results: ' + (outputs.length + that.results.length - currResultCount) + ' out of ' + (that.results.length + outputs.length));
+ dprint('enzymatic', 'New results: ' + (outputs.length + that.results.length - currResultCount) + ' out of ' + (that.results.length + outputs.length));
} catch (e) {
//print("Exception, current selected are: " + inputs.map(dump).join('\n\n'));
print("Stack: " + new Error().stack);