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: Optimize built-in functions name checking and use ConcurrentDictionary<string, WeakReference<LogicalExpression>>
at caching
#114
Conversation
…o string and created ExecuteBuiltInFunction method.
…o optimize-evaluation-visitor
…ally controlling thread-safety
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #114 +/- ##
==========================================
- Coverage 74.30% 74.01% -0.30%
==========================================
Files 20 20
Lines 4480 4433 -47
Branches 274 255 -19
==========================================
- Hits 3329 3281 -48
Misses 1021 1021
- Partials 130 131 +1 ☔ View full report in Codecov by Sentry. |
Thanks for the contribution @gumbarros You mention performance improvements, did you run any tests to confirm it runs faster? |
No, just checked the IL and checked the unit test of concurrency to see if everything is alright. Do you know how can I do a Benchmark to compare two NCalc versions? |
You can use https://github.com/dotnet/BenchmarkDotNet library to measure performance with existing NuGet package |
I'm sorry guys, I'm still feeling sick a bit and can't function properly. PS. @gumbarros, @lucaschimweg — thanks a lot for your contributions! 🚀 |
…e-evaluation-visitor # Conflicts: # src/NCalc/Domain/EvaluationVisitor.cs # src/NCalc/Expression.cs
Ready to merge |
ConcurrentDictionary<string, WeakReference<LogicalExpression>>
at caching
Improve cache management code. This PR is based on ncalc/ncalc#114
* Improve cache management code Improve cache management code. This PR is based on ncalc/ncalc#114 * Update Expression.cs * Cancel rename CleanCache method * Remove cleanCache * Use ConditionalWeakTable for cache * Revert "Use ConditionalWeakTable for cache" This reverts commit 8c3d4c5. * Revert "Remove cleanCache" This reverts commit 728dfd8. * Remove new line
Before:
After:
(At IL it's optimized by string size)