Allowing FastExpressions to allocate on Stack? #342
Replies: 3 comments
-
@Shpendicus Once upon a time I was trying to do that. It was even somewhere in the branch (now deleted). Regarding the short-lived expressions I think it is a good inception for doing that. Another No for this approach (at least for now) is to have API surface compatibility with the System.Linq.Expressions. I immediately broke this rule when trying it out in the branch. Currently, I am trying to save allocations just by minimizing them, e.g. packing things, customizing expressions for the variant number of arguments, etc. But... any ideas are welcome! |
Beta Was this translation helpful? Give feedback.
-
Hey sry for the late answer, was not at home after my post anymore.
I share same belive!
For your interesst; I do know actually a way, to bring .NET objects from Heap to Stack, it involves some dirty ClR hacking but its not toooooo bad, actually. give me time til weekend cause I have to finish a project and then I will slowly begin my journey on this topic for your Library! |
Beta Was this translation helpful? Give feedback.
-
Converting to discussion. |
Beta Was this translation helpful? Give feedback.
-
Pretty much title.
Is this somehow possible, when I can guarantee myself that the Expression wont ever escape the stack-frame it was declared in?
That would be kinda sick, but I fear, it has to do more with how the CLR of .net handles these allocations...
Beta Was this translation helpful? Give feedback.
All reactions