Merge branch 'js-rm-eq' into js-rm-modules
This commit is contained in:
@@ -27,7 +27,7 @@ function TreeNode(left, right) {
|
||||
}
|
||||
|
||||
function itemCheck(node) {
|
||||
if (node.left === null)
|
||||
if (node.left == null)
|
||||
return 1;
|
||||
return 1 + itemCheck(node.left) + itemCheck(node.right);
|
||||
}
|
||||
|
||||
@@ -296,7 +296,7 @@ function benchClosures() {
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
log.console("JavaScript Performance Benchmark");
|
||||
log.console("================================\n");
|
||||
log.console("======================\n");
|
||||
|
||||
// Property Access
|
||||
log.console("BENCHMARK: Property Access");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
var N = 1000000;
|
||||
var N = 10000000;
|
||||
var num = 0;
|
||||
for (var i = 0; i < N; i ++) {
|
||||
var x = 2 * $_.random();
|
||||
@@ -8,4 +8,11 @@ for (var i = 0; i < N; i ++) {
|
||||
}
|
||||
log.console(2 * num / N);
|
||||
|
||||
var a = 100
|
||||
var b = 100
|
||||
|
||||
if ("test") log.console("OK!")
|
||||
|
||||
log.console(a != b)
|
||||
|
||||
$_.stop()
|
||||
@@ -49,7 +49,7 @@ function getStats(arr) {
|
||||
}
|
||||
|
||||
// Pretty print results
|
||||
log.console("\n=== Performance Test Results (100 iterations) ===");
|
||||
log.console("\n== Performance Test Results (100 iterations) ==");
|
||||
log.console("\nJSON Decoding (ms):");
|
||||
def jsonDecStats = getStats(jsonDecodeTimes);
|
||||
log.console(`Average: ${jsonDecStats.avg.toFixed(2)} ms`);
|
||||
|
||||
@@ -76,7 +76,7 @@ def benchmarks = [
|
||||
|
||||
// Print a header
|
||||
log.console("Wota Encode/Decode Benchmark");
|
||||
log.console("============================\n");
|
||||
log.console("===================\n");
|
||||
|
||||
// We'll run each benchmark scenario in turn.
|
||||
for (let bench of benchmarks) {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
//
|
||||
|
||||
// Parse command line arguments
|
||||
if (arg.length !== 2) {
|
||||
if (arg.length != 2) {
|
||||
log.console('Usage: cell benchmark_wota_nota_json.ce <LibraryName> <ScenarioName>');
|
||||
$_.stop()
|
||||
}
|
||||
@@ -139,7 +139,7 @@ function runBenchmarkForLibrary(lib, bench) {
|
||||
let e = lib.encode(bench.data[j]);
|
||||
// store only in the very first iteration, so we can decode them later
|
||||
// but do not store them every iteration or we blow up memory.
|
||||
if (i === 0) {
|
||||
if (i == 0) {
|
||||
encodedList.push(e);
|
||||
totalSize += lib.getSize(e);
|
||||
}
|
||||
@@ -166,8 +166,8 @@ function runBenchmarkForLibrary(lib, bench) {
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Find the requested library and scenario
|
||||
var lib = libraries.find(l => l.name === lib_name);
|
||||
var bench = benchmarks.find(b => b.name === scenario_name);
|
||||
var lib = libraries.find(l => l.name == lib_name);
|
||||
var bench = benchmarks.find(b => b.name == scenario_name);
|
||||
|
||||
if (!lib) {
|
||||
log.console('Unknown library:', lib_name);
|
||||
|
||||
Reference in New Issue
Block a user