Skip to content
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

Parse .dump-hi files of library components only once #2658

Merged
merged 1 commit into from
Oct 3, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ Bug fixes:
[#2568](https://github.com/commercialhaskell/stack/issues/2568)
* Fixed running `stack hpc report` on package targets.
[#2664](https://github.com/commercialhaskell/stack/issues/2664)
* Fix a long-standing performance regression where stack would parse the .dump-hi
files of the library components of local packages twice.
[#2658](https://github.com/commercialhaskell/stack/pull/2658)

## 1.2.0

Expand Down
2 changes: 1 addition & 1 deletion src/Stack/Package.hs
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ libraryFiles lib = do
resolveFilesAndDeps
Nothing
(dirs ++ [dir])
(names <> exposed)
names
Copy link
Member Author

@sjakobi sjakobi Oct 1, 2016

Choose a reason for hiding this comment

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

This line alone would be a sufficient fix (see names = bnames ++ exposed!) but I felt that Set is the better datastructure than [] in this case. Order isn't doesn't seem to be important and we don't want any duplicates.

I actually think that we should use Set instead of [] much more pervasively to prevent ourselves from wondering whether duplicates and order actually matter in each case.

Copy link
Contributor

Choose a reason for hiding this comment

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

My reasoning for not having it be a Set is that there is cost to constructing the Set, and we always convert it from / to a list. It is semantically more correct, though, indeed!

haskellModuleExts
cfiles <- buildOtherSources build
return (modules, files <> cfiles, warnings)
Expand Down