-
-
Notifications
You must be signed in to change notification settings - Fork 231
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
Introduce Sliding Cache to Constant Expression Helper #765
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR.
Can you look at the review comments please?
src/System.Linq.Dynamic.Core/Parser/ConstantExpressionHelper.cs
Outdated
Show resolved
Hide resolved
…ache Tests Added
…xpressionHelper
@StefH - Ok, implemented the feedback above, with the exception of a configuration process as I think that really isn't needed for this (not sure who would be trying to tune this, this is just the library keeping itself clean so the GC can do its job).
Thanks for the idea of the Mock DateTime - I can use that a lot on my own project tests! |
|
src/System.Linq.Dynamic.Core/Parser/ConstantExpressionHelper.cs
Outdated
Show resolved
Hide resolved
test/System.Linq.Dynamic.Core.Tests/Util/ThreadSafeSlidingCacheTests.cs
Outdated
Show resolved
Hide resolved
test/System.Linq.Dynamic.Core.Tests/Util/ThreadSafeSlidingCacheTests.cs
Outdated
Show resolved
Hide resolved
test/System.Linq.Dynamic.Core.Tests/Util/ThreadSafeSlidingCacheTests.cs
Outdated
Show resolved
Hide resolved
test/System.Linq.Dynamic.Core.Tests/Util/ConstantExpressionHelperTests.cs
Outdated
Show resolved
Hide resolved
… feedback from Review
Feedback on the Latest Check-In:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes, only a few comments left. can you please take a look?
src/System.Linq.Dynamic.Core/Parser/ConstantExpressionHelper.cs
Outdated
Show resolved
Hide resolved
src/System.Linq.Dynamic.Core/Parser/ConstantExpressionHelper.cs
Outdated
Show resolved
Hide resolved
src/System.Linq.Dynamic.Core/Parser/ConstantExpressionHelper.cs
Outdated
Show resolved
Hide resolved
test/System.Linq.Dynamic.Core.Tests/Util/Cache/ThreadSafeSlidingCacheTests.cs
Outdated
Show resolved
Hide resolved
@TWhidden |
…view Resolutions
My bad on "Resolve conversation" - that would have helped me also when going through them all. Was thinking about the new Also - |
SlidingCache is also fine for me. |
If it makes it easier, yes you can do it. |
src/System.Linq.Dynamic.Core/Parser/ConstantExpressionHelper.cs
Outdated
Show resolved
Hide resolved
test/System.Linq.Dynamic.Core.Tests/Util/Cache/ThreadSafeSlidingCacheTests.cs
Outdated
Show resolved
Hide resolved
@TWhidden |
@TWhidden |
Hey @StefH - We need to look a little into this. I think with high contention, we are creating some errors. Here is our Sentry report stack trace. I propose some minor changes: If you are ok with it, I would love to do another PR for it. Hopefully with less hassle this time to your process. |
Ill Open a new issue - and submit a PR; |
Introduce a Sliding Cache to ConstantExpressionHelper.
ThreadSafeSlidingCache
which has a constructor option of TTL for the object expire period, as well as an override for the cleanup frequency - default of 10 seconds atm - figured that would not add a huge strain, but can be adjusted as desired. did not know where we would put this class in the folder structure, feel free to refactor. It uses a "Lazy" Expire, so there is no timer, but objects expire when the cache is accessed.