rm array proto funcs

This commit is contained in:
2026-01-21 00:52:18 -06:00
parent ef49606098
commit 26fce3a5a8
31 changed files with 259 additions and 372 deletions

View File

@@ -109,12 +109,12 @@ function benchArrayOps() {
var pushTime = measureTime(function() {
var arr = [];
for (var i = 0; i < iterations.medium; i++) {
arr.push(i);
push(arr, i);
}
});
var arr = [];
for (var i = 0; i < 10000; i++) arr.push(i);
for (var i = 0; i < 10000; i++) push(arr, i);
var accessTime = measureTime(function() {
var sum = 0;
@@ -198,7 +198,7 @@ function benchStringOps() {
var strings = [];
for (var i = 0; i < 1000; i++) {
strings.push("string" + i);
push(strings, "string" + i);
}
var joinTime = measureTime(function() {
@@ -269,13 +269,13 @@ function benchClosures() {
var closureCreateTime = measureTime(function() {
var funcs = [];
for (var i = 0; i < iterations.medium; i++) {
funcs.push(makeAdder(i));
push(funcs, makeAdder(i));
}
});
var adders = [];
for (var i = 0; i < 1000; i++) {
adders.push(makeAdder(i));
push(adders, makeAdder(i));
}
var closureCallTime = measureTime(function() {

View File

@@ -9,7 +9,7 @@ var newarr = []
var accstr = ""
for (var i = 0; i < 10000; i++) {
accstr += i;
newarr.push(i.toString())
newarrpush(i.toString())
}
// Arrays to store timing results
var jsonDecodeTimes = [];
@@ -23,22 +23,22 @@ for (var i = 0; i < 100; i++) {
// JSON Decode test
var start = os.now();
var jll = json.decode(ll);
jsonDecodeTimes.push((os.now() - start) * 1000);
jsonDecodeTimespush((os.now() - start) * 1000);
// JSON Encode test
start = os.now();
var jsonStr = JSON.stringify(jll);
jsonEncodeTimes.push((os.now() - start) * 1000);
jsonEncodeTimespush((os.now() - start) * 1000);
// NOTA Encode test
start = os.now();
var nll = nota.encode(jll);
notaEncodeTimes.push((os.now() - start) * 1000);
notaEncodeTimespush((os.now() - start) * 1000);
// NOTA Decode test
start = os.now();
var oll = nota.decode(nll);
notaDecodeTimes.push((os.now() - start) * 1000);
notaDecodeTimespush((os.now() - start) * 1000);
}
// Calculate statistics

View File

@@ -139,7 +139,7 @@ function runBenchmarkForLibrary(lib, bench) {
// 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) {
encodedList.push(e);
push(encodedList, e);
totalSize += lib.getSize(e);
}
}