remove dynamic equality

This commit is contained in:
2025-06-16 13:48:09 -05:00
parent 9c0565d34f
commit 794baf8598
70 changed files with 462 additions and 461 deletions

View File

@@ -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);
}

View File

@@ -296,7 +296,7 @@ function benchClosures() {
////////////////////////////////////////////////////////////////////////////////
log.console("JavaScript Performance Benchmark");
log.console("================================\n");
log.console("======================\n");
// Property Access
log.console("BENCHMARK: Property Access");

View File

@@ -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()

View File

@@ -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):");
const jsonDecStats = getStats(jsonDecodeTimes);
log.console(`Average: ${jsonDecStats.avg.toFixed(2)} ms`);

View File

@@ -76,7 +76,7 @@ const 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) {

View File

@@ -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);