From 14f78674ab2cda78ba594cf382b67d1794a746f8 Mon Sep 17 00:00:00 2001 From: perf-bundle Date: Wed, 2 Sep 2026 15:07:35 +0200 Subject: [PATCH] Avoid per-call FSharpFunc closure in remapVal member-info remap The Option.map mapping in remapValData was a partial application of remapMemberInfo, reified into a per-call FSharpFunc even though Option.map is inline. A syntactic lambda lets [] fire and lowers it to a direct call, removing one ~72 B closure allocation per copied Val. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 63a36ad7-0e8a-497d-9e96-7d7f03828b9a --- src/Compiler/TypedTree/TypedTreeOps.Remapping.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Compiler/TypedTree/TypedTreeOps.Remapping.fs b/src/Compiler/TypedTree/TypedTreeOps.Remapping.fs index f8564249d03..528519476f0 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.Remapping.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.Remapping.fs @@ -1693,7 +1693,7 @@ module internal ExprRemapping = let memberInfoR = d.MemberInfo - |> Option.map (remapMemberInfo ctxt d.val_range valReprInfo ty tyR tmenv) + |> Option.map (fun mi -> remapMemberInfo ctxt d.val_range valReprInfo ty tyR tmenv mi) let attribsR = d.Attribs |> remapAttribs ctxt tmenv