Skip to content

Draft: Slightly more efficient exprFreeVars/Ids

Yiyun Liu requested to merge yiyunliu/ghc:expr-folder-mr into master

This patch rewrites the non-deterministic exprFreeVar/Id functions using Endo, similar to the implementation in GHC.Core.TyCo.FVs for types.

The ExprFolder data type is not exported. It is currently quite ad-hoc and doesn't see any use besides extracting free variables from expressions.

This patch gives a moderate performance boost with -0.1% geo.mean for ghc/alloc.

Edited by Andreas Klebinger

Merge request reports