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,17 @@
'use strict';
const util = require('util');
const total = parseInt(process.env.TEST_ALLOCATION) || 100;
let count = 0;
let string = '';
function runAllocation() {
string += util.inspect(process.env);
if (count++ < total) {
setTimeout(runAllocation, 1);
} else {
console.log(string.length);
process.exit(55);
}
}
setTimeout(runAllocation, 1);

View File

@ -0,0 +1,17 @@
'use strict';
const util = require('util');
const total = parseInt(process.env.TEST_ALLOCATION) || 100;
let count = 0;
let string = '';
function runAllocation() {
string += util.inspect(process.env);
if (count++ < total) {
setTimeout(runAllocation, 1);
} else {
console.log(string.length);
process.kill(process.pid, "SIGINT");
}
}
setTimeout(runAllocation, 1);

View File

@ -0,0 +1,11 @@
'use strict';
const { Worker } = require('worker_threads');
const path = require('path');
new Worker(path.join(__dirname, 'allocation.js'), {
execArgv: [
'--heap-prof',
'--heap-prof-interval',
process.HEAP_PROF_INTERVAL || '128',
]
});

View File

@ -0,0 +1,5 @@
'use strict';
const { Worker } = require('worker_threads');
const path = require('path');
new Worker(path.join(__dirname, 'allocation.js'));

16
test/fixtures/workload/allocation.js vendored Normal file
View File

@ -0,0 +1,16 @@
'use strict';
const util = require('util');
const total = parseInt(process.env.TEST_ALLOCATION) || 100;
let count = 0;
let string = '';
function runAllocation() {
string += util.inspect(process.env);
if (count++ < total) {
setTimeout(runAllocation, 1);
} else {
console.log(string.length);
}
}
setTimeout(runAllocation, 1);

22
test/fixtures/workload/bounded.js vendored Normal file
View File

@ -0,0 +1,22 @@
'use strict';
const total = parseInt(process.env.TEST_ALLOCATION) || 5000;
const chunk = parseInt(process.env.TEST_CHUNK) || 1000;
const cleanInterval = parseInt(process.env.TEST_CLEAN_INTERVAL) || 100;
let count = 0;
let arr = [];
function runAllocation() {
count++;
if (count < total) {
if (count % cleanInterval === 0) {
arr.splice(0, arr.length);
setImmediate(runAllocation);
} else {
const str = JSON.stringify(process.config).slice(0, chunk);
arr.push(str);
setImmediate(runAllocation);
}
}
}
setImmediate(runAllocation);

View File

@ -0,0 +1,7 @@
'use strict';
function fib(n) {
if (n === 0 || n === 1) return n;
return fib(n - 1) + fib(n - 2);
}
fib(parseInt(process.argv[2]) || 35);
process.exit(55);

View File

@ -0,0 +1,7 @@
'use strict';
function fib(n) {
if (n === 0 || n === 1) return n;
return fib(n - 1) + fib(n - 2);
}
fib(parseInt(process.argv[2]) || 35);
process.kill(process.pid, "SIGINT");

View File

@ -0,0 +1,11 @@
'use strict';
const { Worker } = require('worker_threads');
const path = require('path');
new Worker(path.join(__dirname, 'fibonacci.js'), {
execArgv: [
'--cpu-prof',
'--cpu-prof-interval',
process.env.CPU_PROF_INTERVAL || '100'
]
});

View File

@ -0,0 +1,5 @@
'use strict';
const { Worker } = require('worker_threads');
const path = require('path');
new Worker(path.join(__dirname, 'fibonacci.js'));

8
test/fixtures/workload/fibonacci.js vendored Normal file
View File

@ -0,0 +1,8 @@
'use strict';
function fib(n) {
if (n === 0 || n === 1) return n;
return fib(n - 1) + fib(n - 2);
}
const n = parseInt(process.env.FIB, 10) || 40;
process.stdout.write(`${fib(n)}\n`);

View File

@ -0,0 +1,9 @@
'use strict';
const path = require('path');
const v8 = require('v8');
v8.setHeapSnapshotNearHeapLimit(+process.env.limit);
if (process.env.limit2) {
v8.setHeapSnapshotNearHeapLimit(+process.env.limit2);
}
require(path.resolve(__dirname, 'grow.js'));

View File

@ -0,0 +1,15 @@
'use strict';
const path = require('path');
const { Worker } = require('worker_threads');
const max_snapshots = parseInt(process.env.TEST_SNAPSHOTS) || 1;
new Worker(path.join(__dirname, 'grow-and-set-near-heap-limit.js'), {
env: {
...process.env,
limit: max_snapshots,
},
resourceLimits: {
maxOldGenerationSizeMb:
parseInt(process.env.TEST_OLD_SPACE_SIZE) || 20
}
});

14
test/fixtures/workload/grow-worker.js vendored Normal file
View File

@ -0,0 +1,14 @@
'use strict';
const { Worker } = require('worker_threads');
const path = require('path');
const max_snapshots = parseInt(process.env.TEST_SNAPSHOTS) || 1;
new Worker(path.join(__dirname, 'grow.js'), {
execArgv: [
`--heapsnapshot-near-heap-limit=${max_snapshots}`,
],
resourceLimits: {
maxOldGenerationSizeMb:
parseInt(process.env.TEST_OLD_SPACE_SIZE) || 20
}
});

12
test/fixtures/workload/grow.js vendored Normal file
View File

@ -0,0 +1,12 @@
'use strict';
const chunk = parseInt(process.env.TEST_CHUNK) || 1000;
let arr = [];
function runAllocation() {
const str = JSON.stringify(process.config).slice(0, chunk);
arr.push(str);
setImmediate(runAllocation);
}
setImmediate(runAllocation);