Feedback and Issues #438
Replies: 7 comments 17 replies
-
@MattEdwardsWaggleBee Hi, Matt. Thanks for the good roundup of the potential bugs :-) I will walk them one-by-one and will create the respective issues myself. |
Beta Was this translation helpful? Give feedback.
-
@MattEdwardsWaggleBee Regarding the helpers for the Here is the entry point: https://github.com/dadhi/FastExpressionCompiler/blob/f92ba2fa7ca4bb17a6ff8a7a54ea0708a4d7787e/test/FastExpressionCompiler.LightExpression.IssueTests/ObjectMethodExecutor/ObjectMethodExecutorCompiledFastClosure.cs There are also some benchmarks there. |
Beta Was this translation helpful? Give feedback.
-
@MattEdwardsWaggleBee I would say no. Here is the context for my experiments #72 |
Beta Was this translation helpful? Give feedback.
-
Would it be helpful? https://dotnet.github.io/dotNext/features/metaprogramming/async.html |
Beta Was this translation helpful? Give feedback.
-
Hi, I have added the two issues #439 and #440 and did some tests and fixes for them. @wip Btw, I am usually using the same procedure to adding the failed tests for the new issues. If you do it for the upcoming issues in the PRs, it may speedify my fixes. Thank you. |
Beta Was this translation helpful? Give feedback.
-
@MattEdwardsWaggleBee I have released the v5.0.1 with fixes for this discussion and #437 |
Beta Was this translation helpful? Give feedback.
-
@dadhi was going to say I'll take a look tomorrow, but I couldn't wait. I updated my Nugets and all my tests are passing now! We are seeing close to native speeds with our async/await library! (https://github.com/Stillpoint-Software/hyperbee.expressions) Thank you so much for your help and your project!. ❤️
|
Beta Was this translation helpful? Give feedback.
-
Hello @dadhi,
First off, thank you for creating this project! We've been testing it with our own Hyperbee.Expressions project which adds support
async
/await
and other helpers. These all work as expected with systemCompile
, and we've seen great performance improvements withCompileFast
. However, we've encountered a few issues during implementation, some of which we've worked around, while others remain blockers.All the interesting cases we've found are related to lowering an
async
block into a state machine, similar to what Roslyn does, and then uses Microsoft'sIAsyncStateMachine
to deal with task continuation and completion. Below we've listed the issues, but we also have test cases in our repo in the FastExpressionCompilerTests.cs file as part of our Add Support for Fast Expression Compiler work.We've addressed as many of these issues as we can, but we wanted to reach out to you to see if you had any insights or guidance. We're happy to open detailed issues for each of these if that would be helpful, but didn't feel right just adding several issues to your repo without context. What would be the best way to proceed?
Thank you again for your work on this library! We're excited to use it in several of our projects.
Best regards,
@bfarmer67 and @MattEdwardsWaggleBee
Unused Expressions
When unused expressions are introduced in the expression tree, we encountered issues. We've resolved this by cleaning up our code to avoid adding these unnecessary snippets. (We didn't actually see these issues originally, so this help us clean up our code nicely!)
Passing Ref Values to Lambda
When attempting to pass results as ref to a lambda, we ran into problems. We've implemented a workaround by assigning the result to a local variable first before passing it to the lambda.
Single-Test Switch Without a Default Case
If a switch contains only one TestValue and no default case, we get an error during conditional generation. This seems to occur even when such a structure would otherwise be valid.
Switch Without Any Test Cases
If a switch contains zero test cases it throws
System.ArgumentOutOfRangeException: Index was out of range.
. In this case we optimized our code to avoid this scenario.TryCatch And Goto
When the last statement in a TryCatch block is a goto and the label is on the outside, we encounter an
System.InvalidProgramException: Common Language Runtime detected an invalid program.
error. We haven’t been able to find a reliable workaround for this yet.Additionally we also found that when the label is moved into the same scope as the goto we get
System.ArgumentException: Bad label content in ILGenerator.
Beta Was this translation helpful? Give feedback.
All reactions