on master help sign in
make PERF note about long definitions in let
commit5e73421f7f6bb50bb4d6832a4da2fba6df80163b authorEvan Czaplicki <evancz@users.noreply.github.com> dateWed 3 Jul 2019, 18:42 (7 years ago) parent879f285
1 file changed+7
compiler/src/Type/Solve.hs+7
compiler/src/Type/Solve.hs+7
@@ -427,6 +427,13 @@ typeToVariable rank pools tipe =
427427 typeToVar rank pools Map.empty tipe
428428
429429
430+-- PERF working with @mgriffith we noticed that a 784 line entry in a `let` was
431+-- causing a ~1.5 second slowdown. Moving it to the top-level to be a function
432+-- saved all that time. The slowdown seems to manifest in `typeToVar` and in
433+-- `register` in particular. Have not explored further yet. Top-level definitions
434+-- are recommended in cases like this anyway, so there is at least a safety
435+-- valve for now.
436+--
430437typeToVar :: Int -> Pools -> Map.Map Name.Name Variable -> Type -> IO Variable
431438typeToVar rank pools aliasDict tipe =
432439 let go = typeToVar rank pools aliasDict in