-
Notifications
You must be signed in to change notification settings - Fork 144
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
chore: formatter caching #1700
chore: formatter caching #1700
Conversation
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work on the perf 🙌
I'm wondering if the CACHEs need to be top level RefCell?
Could it be stored in the Aggregator directly?
pub struct Aggregator {
...,
expr_cache: HashMap<(usize, String),
list_cache: HashMap<(usize, String),
}
Or what are benefits with the refcell approach here?
@hugocaillard simplified the cache a bit. Also removed the redundant segment of raw source from clarity-bitcoin since we already test that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm ⚡
simple caching to speed up benchmarks
Main changes:
slice::from_ref
when passing exprs into recursiondisplay_pse
andformat_source_exprs
)