Upload Kmake

This commit is contained in:
Gorochu
2026-05-26 23:36:42 -07:00
parent ba051b2f74
commit 555ec72358
41615 changed files with 13344630 additions and 1 deletions

View File

@ -0,0 +1,25 @@
// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
load('../base.js');
load('switch_statement.js');
var success = true;
function PrintResult(name, result) {
print(name + '-SwitchStatement(Score): ' + result);
}
function PrintError(name, error) {
PrintResult(name, error);
success = false;
}
BenchmarkSuite.config.doWarmup = undefined;
BenchmarkSuite.config.doDeterministic = undefined;
BenchmarkSuite.RunSuites({ NotifyResult: PrintResult,
NotifyError: PrintError });

View File

@ -0,0 +1,29 @@
// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// running on old version takes approximately 50 seconds, so 50,000 milliseconds
new BenchmarkSuite('Big-Switch', [50000], [
new Benchmark('Big-Switch', false, false, 0, BigSwitch),
]);
function BigSwitch() {
"use strict";
const n = 100000;
const c = (a, b) => Array(a).fill().map((a, c) => b(c));
Function('n, c',
`
const a = c(n, a => a);
let ctr = 0;
for(let i = 0; i !== (1+n); i++){
switch(i){
${c(n, a => `case ${a}: ctr += i; break;`).join('\n')}
default: ctr += i; break;
}
}
return ctr;
`)(n,c);
}