@shapeshift-labs/frontier-lang-parser 0.3.0 → 0.3.1
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/bench/smoke.mjs +13 -0
- package/benchmarks/package-bench.mjs +1 -0
- package/package.json +9 -3
package/bench/smoke.mjs
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { performance } from 'node:perf_hooks';
|
|
2
|
+
import { parseFrontierSource } from '../dist/index.js';
|
|
3
|
+
|
|
4
|
+
const blocks = Array.from({ length: 100 }, (_, index) => `entity Todo${index} @id("ent_${index}") {
|
|
5
|
+
title @id("field_title_${index}"): Text { merge conflict }
|
|
6
|
+
tags @id("field_tags_${index}"): Set<Text> { merge union law semilattice }
|
|
7
|
+
}`).join('\n');
|
|
8
|
+
const source = `module Bench @id("mod_bench") {\n${blocks}\n}`;
|
|
9
|
+
const start = performance.now();
|
|
10
|
+
let document;
|
|
11
|
+
for (let index = 0; index < 250; index += 1) document = parseFrontierSource(source);
|
|
12
|
+
const durationMs = performance.now() - start;
|
|
13
|
+
console.log(JSON.stringify({ parses: 250, nodes: Object.keys(document.nodes).length, durationMs: Math.round(durationMs * 100) / 100 }, null, 2));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '../bench/smoke.mjs';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shapeshift-labs/frontier-lang-parser",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Parser for the first Frontier Lang .frontier syntax slice.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -16,11 +16,14 @@
|
|
|
16
16
|
"dist",
|
|
17
17
|
"examples",
|
|
18
18
|
"README.md",
|
|
19
|
-
"LICENSE"
|
|
19
|
+
"LICENSE",
|
|
20
|
+
"bench",
|
|
21
|
+
"benchmarks/package-bench.mjs"
|
|
20
22
|
],
|
|
21
23
|
"scripts": {
|
|
22
24
|
"build": "node scripts/build.mjs",
|
|
23
25
|
"test": "npm run build && node test/smoke.mjs",
|
|
26
|
+
"typecheck": "node ./node_modules/typescript/bin/tsc --noEmit -p test/tsconfig.json",
|
|
24
27
|
"fuzz": "npm run build && node fuzz/smoke.mjs",
|
|
25
28
|
"bench": "npm run build && node bench/smoke.mjs",
|
|
26
29
|
"prepare": "npm run build",
|
|
@@ -50,6 +53,9 @@
|
|
|
50
53
|
"access": "public"
|
|
51
54
|
},
|
|
52
55
|
"dependencies": {
|
|
53
|
-
"@shapeshift-labs/frontier-lang-kernel": "0.3.
|
|
56
|
+
"@shapeshift-labs/frontier-lang-kernel": "0.3.1"
|
|
57
|
+
},
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"typescript": "^5.9.3"
|
|
54
60
|
}
|
|
55
61
|
}
|