Skip to content
Discussion options

You must be logged in to vote

I looked into this and it looks like the long compile time is dominated by the pest grammar parsing.
Unfortunately, this may not be something easily fixable in the short time. As a workaround, I suggest building/generating the grammar separately into a Rust file once (or just whenever the grammar changes) similarly to the bootstrap: https://github.com/pest-parser/pest/blob/master/bootstrap/src/main.rs

so instead of using the derive macro

#[grammar = "grammar.pest"]
pub struct GrammarParser;

you can just generate the parser code once into something like https://github.com/pest-parser/pest/blob/master/meta/src/grammar.rs

That way changes in your code won't trigger (long) re-parsing of the …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Thewbi
Comment options

Answer selected by tomtau
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants
Converted from issue

This discussion was converted from issue #1172 on July 03, 2026 15:58.