-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Implement Serde for AstNode types #6605
base: master
Are you sure you want to change the base?
Conversation
CodSpeed Performance ReportMerging #6605 will improve performances by 21%Comparing Summary
Benchmarks breakdown
|
Could you maybe expand a bit on how this will work? |
9864851
to
ead5541
Compare
Hey @tritao sorry for the delay, just getting back to this work now. So the motivation for this was noticing really high RAM usage in the language server now. For example, just running the counter example we can see 800mb of heap memory is never deallocated after the first compilation pass. On digging it seems this is due to the new module caching where we hold onto the types themselves, thus never allow #[derive(Clone, Debug)]
pub struct TypedModuleInfo {
pub module: Arc<TyModule>,
pub version: Option<u64>,
} My motivation was to Serialize these types using postcard (same that is used in fuel-core) and then store the Serialize version in the module cache. We then need to Deserialize back into the original type on each keystroke which will incur some performance overhead but I haven't got any measurements yet, was going to tackle that in an up coming PR. WDYT, are you happy with the approach or do you think there is a better solution? |
Description
This PR extends Serde support across all AstNode-related types, building upon the partial implementation from #4193. Key points:
Serialize
andDeserialize
trait implementations to all relevant types.Checklist
Breaking*
orNew Feature
labels where relevant.