-
Notifications
You must be signed in to change notification settings - Fork 52
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
Split syntax module to reduce compilation time #1852
Conversation
Hi @nitinprakash96, thanks, this is fantastic!
For sure, if you'd like to work on splitting it up further that would be great. I'm imagining that in the end the If you click on "Details" next to the failed 'restyled' check, it will take you to a page with instructions on how to apply the restyling. Alternatively you can run |
I've made further splits and added top level comments (see description box for the changes). However, I'm tempted to move |
86e26b4
to
30fd322
Compare
I think moving |
@nitinprakash96, congrats on having your first PR accepted to Swarm! We appreciate the contribution and we're really glad to welcome you as part of the community. In a minute we will send you an invite to the repo (see https://github.com/swarm-game/swarm/blob/main/CONTRIBUTING.md#i-have-push-access-to-the-swarm-repository-now-what ). If you use IRC, feel free to also join the |
Hello,
Splitting
Swarm.Language.Syntax
into submodules reduces the compilation time quite a bit. Currently, it takes the most of time out of all the modules. Here's a chart:That's ~20s for simplifier (with overall compilation time of 4.3 mins)
Just taking out the types and functions related to
Constants
and putting them in a separate module results in:Thats ~8.5 seconds for simplifier (with overall compilation time of 3.9 mins)
Just for added info, timings taken on a 2019 macbook with i7 processor (6 core and 32 GB RAM)
Changes include:
Swarm.Language.Syntax
split into the following modules:Swarm.Language.Syntax.Comments
- Types for working with comments.Swarm.Language.Syntax.Type
- Core types (Syntax'
,Term'
andDelayType
)Swarm.Language.Syntax.Pattern
- Pattern synonyms for untyped termsSwarm.Language.Syntax.Loc
- Types for working with location in source code (SrcLoc
and related types)Swarm.Language.Syntax.Util
- Helper functions (Eg:mkTuple
,freeVarsS
etc)Compilation chart after the split:
Swarm.Language.Syntax
is no longer the most time taking module.Closes #1844