You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code in Juvix.Compiler.Internal.Data.InfoTable takes ridiculously long:
letFunctionDefs :: (Data from) => from -> [FunctionDef]
letFunctionDefs e =
concat
[ concatMap (toList . flattenClause) _letClauses
| Let {..} <- universeBi e
]
where
flattenClause :: LetClause -> NonEmpty FunctionDef
flattenClause = \case
LetFunDef f -> pure f
LetMutualBlock (MutualBlockLet fs) -> fs
It is responsible for over 10% of compilation time.
The problem seems to be the use of generic traversal with universeBi and automatically derived instances. The documentation of uniplate mentions that one can achieve a 5x speedup by using Data.Generics.Uniplate.Direct instead of Data.Generics.Uniplate.Data and implementing the instances manually.
The text was updated successfully, but these errors were encountered:
The following code in
Juvix.Compiler.Internal.Data.InfoTable
takes ridiculously long:It is responsible for over 10% of compilation time.
The problem seems to be the use of generic traversal with
universeBi
and automatically derived instances. The documentation ofuniplate
mentions that one can achieve a 5x speedup by usingData.Generics.Uniplate.Direct
instead ofData.Generics.Uniplate.Data
and implementing the instances manually.The text was updated successfully, but these errors were encountered: