FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

load modules concurrently #4545 by roryc89 · Pull Request #4549 · purescript/purescript · GitHub

load modules concurrently #4545 - #4549

Open
roryc89 wants to merge 2 commits into
purescript:masterfrom
OxfordAbstracts:load-modules-concurrently
Open

load modules concurrently #4545#4549
roryc89 wants to merge 2 commits into
purescript:masterfrom
OxfordAbstracts:load-modules-concurrently

Conversation

roryc89 commented Aug 1, 2024
edited
Loading

Copy link
Copy Markdown
Contributor

Description of the change

On large projects loading the modules concurrently lowers memory usage substantially. Should help address #4545

Checklist:

Relevant checklist points addressed in #4546

Copy link
Copy Markdown

@f-f anything blocking merge here? this change looks lovely

f-f commented Sep 21, 2024

Copy link
Copy Markdown
Member

We'll need another review from the core team - could anyone take a look?

rhendric left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Nits aside, I'm surprised that this is reported to decrease memory use because my understanding is that mapConcurrently will spawn every one of these tasks at once. Has that been confirmed on very large projects? What about consumption of other resources—open file handles or something?

I'd be more comfortable with this if we used primitives like pooledMapConcurrently instead. OTOH, I don't do much maintenance of the Ide modules so if the team members who do are happy with this I won't block it.

import Language.PureScript.Ide.Usage (findUsages)
import System.Directory (getCurrentDirectory, getDirectoryContents, doesDirectoryExist, doesFileExist)
import System.FilePath ((</>), normalise)
import Control.Concurrent.Async.Lifted (mapConcurrently, mapConcurrently_)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Nit: insert into the imports in alphabetical order, please.

Comment on lines +32 to +33
import Control.Concurrent.Async.Lifted (mapConcurrently)
import Control.Monad.Trans.Control (MonadBaseControl)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Same nit.

import Language.PureScript qualified as P
import Language.PureScript.Errors.JSON qualified as P
import Language.PureScript.Ide.Filter.Declaration (DeclarationType(..))
import Control.Monad.Trans.Control (MonadBaseControl)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Same nit.

Copy link
Copy Markdown
Member

Also, I think this does merit its own changelog entry.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL