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 CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.3.64",
6
+ "version": "1.3.65",
7
7
  "description": "EyeProlog turns facts and rules into answers and proofs.",
8
8
  "type": "module",
9
9
  "main": "./index.js",
@@ -87,7 +87,13 @@ export async function runExamples(reporter = new TestReporter()) {
87
87
  .sort();
88
88
 
89
89
  reporter.section('Examples');
90
- await runExampleTasks(files, (name, result) => reporter.testResult(name, result));
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(3, parallelism - 1)));
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();