New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance improvements #5
Conversation
Using Expression.Block to express let binding, which allowed support for VarSet. Needed to changed Patterns.Sequential to use Expression.Block as well.
Not sure if this is the greatest solution; but works.
The While loop code was called from other places, so moved the addition of the Unit type up to there.
Documentation for Expression.GetActionType and Expression.GetFuncType say they support arrays up to 16 & 17 respectively; so removed helpers that duplicated such functionality.
Taking samples from [rosettacode](http://rosettacode.org/)
These are very generous timings to say the least! The linq compiled versions are 30 or some times worse! Lets see what we can do about that...
Operations on non-int types are abysmal!
Added tests; now need to fix...
If Lambdas don't require capturing extra state, then create an instance of a class that derives from OptimizedClosures.FSharpFunc.
In normal Release build the Performance tests are now Ignored.
Just used a Expression.Block
Not sure if anyone is having a look at this; so maybe let me know if you want a stable merge point, or otherwise I'll just bleed things in as my time takes me... Anyway, just as an example of the speed increase, the tests in ...and in complex quotations, with a number of functions and currying, the improvements were much greater (although if there are more than 5 arguments or 8 captured variables then some of my optimizations drop back to original functionality; I could enhance this; these were just the easy values, have to think a bit more to increase these...) |
In complex quotations that throw StackOverflowException, this PR solve the problem. |
Thanks for that; shame I didn't branch from that version! I'll see how I go merging in it in my fork over the w/end. |
Hi guys, I think it would make sense to bring one of you on board to have the ability to accept pull requests and release nuget packages. Could you email myself (donsyme AT fastmail DOT fm) and @forki (sforkmann AT gmail DOT com) if you're interested Thanks |
Fixed a number of issues with performance.
Project:
Expression Tree Creation:
Analysis Time:
Now in many cases get close to compile time speeds (so this library is actually semi-useable!), but could still do with another full round of examination as I know I have left holes, as well as missing functionality (recursive functions to name one big hole that I haven't peered down yet). Hopefully I'll make some time; but I'm pretty burnt out at the moment.