Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

symtable as a generic visitor #113

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions scripts/bench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
* deno run -A dist/bundle.min.js tmp.txt
*/
import { bench, Colors, parse, runBenchmarks } from "../deps.ts";
import type { AST, expr, mod } from "../src/ast/astnodes.ts";
import type { expr, mod } from "../src/ast/astnodes.ts";
import { runParserFromString } from "../src/parser/mod.ts";
import { ASTVisitor } from "../src/ast/astnodes.ts";
import { buildSymbolTable } from "../src/symtable/mod.ts";
import { readString } from "../src/tokenize/readline.ts";
import { tokenize } from "../src/tokenize/tokenize.ts";
Expand Down Expand Up @@ -58,7 +57,7 @@ let astSym: mod | expr;

bench({
name: "symtable",
runs: 200,
runs: 5000,
func(b): void {
astSym ??= runParserFromString(text);
b.start();
Expand All @@ -78,7 +77,7 @@ bench({
},
});

runBenchmarks({ only: /optimize/ }, (p) => {
runBenchmarks({ only: /symtable/ }, (p) => {
if (p.running && p.running.measuredRunsMs.length) {
console.log(p.running.measuredRunsMs[p.running.measuredRunsMs.length - 1], "ms");
} else if (p.results.length) {
Expand Down
Loading