dhall-lang / dhall-haskell

Maintainable configuration files
https://dhall-lang.org/
BSD 3-Clause "New" or "Revised" License
912 stars 213 forks source link

improve Dhall.Map.traverseWithKey performance #2589

Closed imuli closed 3 months ago

imuli commented 4 months ago

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.

I haven't done any benchmarking of traverseWithKey specifically, but this change reduces my overall parse+typecheck+inject+normalize+extract time by ~20%.

winitzki commented 4 months ago

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. https://github.com/dhall-lang/dhall-haskell/pull/2586 Anyone has any ideas? The failure is around libsodium and has to do with macos architectures (x86 vs arm).

imuli commented 4 months ago

Thank you @winitzki!