You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allowing FastExpressions to allocate on Stack? #326
Once upon a time I was trying to do that. It was even somewhere in the branch (now deleted).
But it is hard without inventing your own allocator on stack to represent tree-like nested structures (usually done with references). I could imagine it can be done, especially with the modern .NET and probably with data-oriented data structures, indexes as pointers, etc.
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.
Hey sry for the late answer, was not at home after my post anymore.
Once upon a time I was trying to do that. It was even somewhere in the branch (now deleted). But it is hard without inventing your own allocator on stack to represent tree-like nested structures (usually done with references). I could imagine it can be done, especially with the modern .NET and probably with data-oriented data structures, indexes as pointers, etc.
I share same belive!
Regarding the short-lived expressions I think it is a good inception for doing that.
Oh yea :D
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.
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!
Activity
dadhi commentedon Mar 22, 2022
@Shpendicus
Once upon a time I was trying to do that. It was even somewhere in the branch (now deleted).
But it is hard without inventing your own allocator on stack to represent tree-like nested structures (usually done with references). I could imagine it can be done, especially with the modern .NET and probably with data-oriented data structures, indexes as pointers, etc.
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!
CodingMadness commentedon Mar 23, 2022
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!
dadhi commentedon Jul 24, 2022
Converting to discussion.