eyeprolog 1.3.64 → 1.3.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/test/run-examples.mjs +9 -3
package/package.json
CHANGED
package/test/run-examples.mjs
CHANGED
|
@@ -87,7 +87,13 @@ export async function runExamples(reporter = new TestReporter()) {
|
|
|
87
87
|
.sort();
|
|
88
88
|
|
|
89
89
|
reporter.section('Examples');
|
|
90
|
-
|
|
90
|
+
const deepTaxonomyIndex = files.indexOf('deep-taxonomy-100000.pl');
|
|
91
|
+
if (deepTaxonomyIndex >= 0) {
|
|
92
|
+
await runExampleTasks(files.slice(0, deepTaxonomyIndex + 1), (name, result) => reporter.testResult(name, result), 2);
|
|
93
|
+
await runExampleTasks(files.slice(deepTaxonomyIndex + 1), (name, result) => reporter.testResult(name, result), 3);
|
|
94
|
+
} else {
|
|
95
|
+
await runExampleTasks(files, (name, result) => reporter.testResult(name, result), 3);
|
|
96
|
+
}
|
|
91
97
|
reporter.sectionTotal('examples');
|
|
92
98
|
|
|
93
99
|
reporter.section('Proof examples');
|
|
@@ -96,10 +102,10 @@ export async function runExamples(reporter = new TestReporter()) {
|
|
|
96
102
|
}
|
|
97
103
|
|
|
98
104
|
|
|
99
|
-
async function runExampleTasks(tasks, onResult) {
|
|
105
|
+
async function runExampleTasks(tasks, onResult, maxWorkers) {
|
|
100
106
|
if (tasks.length === 0) return;
|
|
101
107
|
const parallelism = os.availableParallelism?.() ?? os.cpus().length;
|
|
102
|
-
const workerCount = Math.min(tasks.length, Math.max(1, Math.min(
|
|
108
|
+
const workerCount = Math.min(tasks.length, Math.max(1, Math.min(maxWorkers, parallelism - 1)));
|
|
103
109
|
if (workerCount === 1) {
|
|
104
110
|
for (const name of tasks) {
|
|
105
111
|
const startedAt = performance.now();
|