Skip to content

[LQP Meta] Parser and pretty printer benchmarks#218

Open
nystrom wants to merge 4 commits intomainfrom
nn-meta-benchmarks
Open

[LQP Meta] Parser and pretty printer benchmarks#218
nystrom wants to merge 4 commits intomainfrom
nn-meta-benchmarks

Conversation

@nystrom
Copy link
Contributor

@nystrom nystrom commented Feb 25, 2026

Add benchmarks comparing the old Lark/IR-based parser and pretty-printer with the new generated ones.

Results at 20 iterations:

  • Parser: new is 1.46x faster overall. The ir_to_proto emit step adds ~15% on top of the Lark parse.
  • Pretty-printer: old is ~8% faster overall (0.92x). A few files where the new one wins big (fd at 1.69x, context_write at 1.62x) but most lean slightly toward the old IR-based printer.

@nystrom nystrom marked this pull request as ready for review February 25, 2026 15:29
@nystrom nystrom requested a review from comnik February 25, 2026 15:30

```
# Old (Lark-based)
uv run --no-project --with "lqp==0.2.3" python meta/bench/benchmark.py
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clever!

Copy link
Collaborator

@comnik comnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thank you!! Good to see that we're in the same ballpark. I saw you had some tweaks out for the pretty printer already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants