How do InlineIfLambda
vs OptimizedClosures.FSharpFunc
relate to one another?
#14123
-
For a long time, when you created a function that takes another function, which gets used many times over, the best way to optimize it was to use Can or should these things be combined? I'd estimate that if I tried, it could not be inlined anymore. However, when using What would the new advice be for function params that are used in iteration scenarios like Any thoughts on this? /cc @dsyme @vzarytovskii @gusty @TheAngryByrd (sorry for the spam, I just guestimated that most of you have considered this before)? Reason for asking: I'm writing a library for I should note that this is for library functions, not the CE itself. I kinda assume that |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
@abelbraaksma Great to see the TaskSeq work! These are really different mechanisms - and I guess I'd just say "use them how they're used in FSharp.Core".
For something like TaskSeq I would not see much use for the former. The latter could reasonably be used quite widely. |
Beta Was this translation helpful? Give feedback.
@abelbraaksma Great to see the TaskSeq work!
These are really different mechanisms - and I guess I'd just say "use them how they're used in FSharp.Core".
Use InlineIfLambda for things that hugely benefit from inlining and flattening, especially things over super-high-perf primitives like arrays.
Use OptimizedClosures.FSharpFunc in non-inlined things taking curried functions as parameters and using them in loops
For something like TaskSeq I would not see much use for the former. The latter could reasonably be used quite widely.