We were having "one of those chats" in FSSF slack about map and bind — and possibly others after consideration — not being inlined on Option/ValueOption/Result etc.
We came to the preliminary conclusion that there seem to be no strong reasons to have these not be marked inline.
AFAIK pros for inlining:
- They aren't expected to change ever.
- Helps Release stack traces be more focussed.
- Helps code to be faster and lower GC pressure.
- Reduce code bloat (inlining a match vs adding an FSharpFunc type for the binder/mapping etc).
For debug builds the experience may be confusing when you miss those calls in traces and debugging. Having non essential inlining, anything but SRTP, be a compiler switch (maybe already exists?) that's turned off during debug builds could be a decent solution.
Thoughts?
/cc: @dsyme
We were having "one of those chats" in FSSF slack about map and bind — and possibly others after consideration — not being inlined on Option/ValueOption/Result etc.
We came to the preliminary conclusion that there seem to be no strong reasons to have these not be marked
inline.AFAIK pros for inlining:
For debug builds the experience may be confusing when you miss those calls in traces and debugging. Having non essential inlining, anything but SRTP, be a compiler switch (maybe already exists?) that's turned off during debug builds could be a decent solution.
Thoughts?
/cc: @dsyme