Skip to content

with ast takes minutes on a 2,167-line file that check parses in 14 s (lib/std/tommyds/check_.w) #1475

Closed as not planned

Description

@ehartford

with ast (parse and print the AST) is far slower than a full check of the same file:

timeout 60 out/bootstrap/bin/with-stage1 ast lib/std/tommyds/check_.w > /dev/null   # killed at 60 s: 52.4 s user, 99% CPU
out/bootstrap/bin/with-stage1 check lib/std/tommyds/check_.w                     # 14.1 s total, includes the stdlib

(stage1 of origin/main ba2d5d1 + the #1391 parser change; the stage1 before that change behaves the same, and was still running after 19 minutes on this file.) The file is 72 KB and 2,167 lines, a migrated TommyDS source. The parse itself is fast, since check parses it and does the rest of its work in 14 s, so the time goes into printing the AST, which is superlinear somewhere.

Why it matters: ast is the cheap way to ask "does this file still parse". A parser change (here #1391) is validated by comparing parse verdicts over every tracked .w file, and that comparison cannot finish while one file takes minutes.

Expected: time roughly proportional to the size of the AST. The output of ast is the parse tree, so seconds at most for this file.

Activity

  1. ehartford commented on Sep 23, 2026

    @ehartford
    ContributorAuthor

    Duplicate of #1358; the data points are added there.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions