improve Dhall.Map.traverseWithKey performance#2589
Merged
Gabriella439 merged 4 commits intodhall-lang:mainfrom Jun 12, 2024
Merged
improve Dhall.Map.traverseWithKey performance#2589Gabriella439 merged 4 commits intodhall-lang:mainfrom
Gabriella439 merged 4 commits intodhall-lang:mainfrom
Conversation
traverseWithKey currently calls fromList, which creates a new list of keys (and calls nubOrd on it). this is unnecessary, because a traversal doesn't change the keys.
Collaborator
|
Currently the macos build seems to be broken. I've been trying randomly poking around to fix it but I don't really know what I'm doing in this build system. #2586 Anyone has any ideas? The failure is around |
Contributor
Author
|
Thank you @winitzki! |
Gabriella439
approved these changes
Jun 12, 2024
netbsd-srcmastr
pushed a commit
to NetBSD/pkgsrc
that referenced
this pull request
Feb 1, 2025
1.42.2 * [Supports standard version 23.1.0](https://github.com/dhall-lang/dhall-lang/releases/tag/v23.1.0) * [Allow `Natural` and `Integer` literals in binary notation](dhall-lang/dhall-haskell#2540) * Fix macOS build [[#2561](dhall-lang/dhall-haskell#2561)] / [[#2586](dhall-lang/dhall-haskell#2586)] * [`dhall to-directory-tree`: Fix support for empty `Map`s](dhall-lang/dhall-haskell#2609) * [`Dhall.TH`: Improve recompilation checking](dhall-lang/dhall-haskell#2620) * `Dhall.TH` utilities now use `addDependentFile` internally so that GHC will recompile if any Dhall dependencies change * Performance improvements * Optimize `Natural/fold`: [[#2585](dhall-lang/dhall-haskell#2585)] / [[#2596](dhall-lang/dhall-haskell#2596)] * [Improve `Dhall.Map.traverseWithKey` performance](dhall-lang/dhall-haskell#2589) * The fold will now short-circuit if it reaches a fixed point * [#2611](dhall-lang/dhall-haskell#2611) * Fixes and improvements to test suite * [#2593](dhall-lang/dhall-haskell#2593) * Fixes and improvements to haddocks * [#2546](dhall-lang/dhall-haskell#2546) * Fixes and improvements to code formatting * [#2608](dhall-lang/dhall-haskell#2608)
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
traverseWithKeycurrently callsfromList, which creates a new list of keys (and callsnubOrdon it). this is unnecessary, because a traversal doesn't change the keys.I haven't done any benchmarking of
traverseWithKeyspecifically, but this change reduces my overall parse+typecheck+inject+normalize+extract time by ~20%.