@@ -427,6 +427,13 @@ typeToVariable rank pools tipe =
427 typeToVar rank pools Map.empty tipe
427 typeToVar rank pools Map.empty tipe
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
430typeToVar :: Int -> Pools -> Map.Map Name.Name Variable -> Type -> IO Variable
437typeToVar :: Int -> Pools -> Map.Map Name.Name Variable -> Type -> IO Variable
431typeToVar rank pools aliasDict tipe =
438typeToVar rank pools aliasDict tipe =
432 let go = typeToVar rank pools aliasDict in
439 let go = typeToVar rank pools aliasDict in