-
Notifications
You must be signed in to change notification settings - Fork 569
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
Functions in session #270
Functions in session #270
Conversation
…bines both the listener and functions. Both legacy kv and client session provide struct based implementation to minimize impact of having interface calls.
Fixed naming (at least to my liking). |
Thanks for the contribution. As this is a breaking change, we need to better understand what benefits it brings users, in order to justify the change. @tli2 what do you think of this: "For now I duplicated state machine code for sync and async versions, if this is not ideal I can unify into one method again." |
I only took a cursory look. In principle I think that's the right thing to do. For this particular case there also seems to be not too much actual code duplication. If I am to be nit-picky I'd say we need a better model for when it is appropriate to use which, and reflect that in the API naming and documentation. We might also consider enforcing that separation in the code (e.g. if we decide that Not necessarily within the scope of this PR, of course. |
Should I experiment with moving |
One (relatively annoying) issue with moving Can slightly reduce the noise by adding helper "builder" (still need to specify
|
I think it would be great for us to support net 462 as well, so those changes are welcome, I would think, as long as perf is unaffected. |
Fixed a bug where compaction would use stale value if multiple records with different lengths (for varlen structs) where encountered during compaction.
…antavicius/FASTER into functions_in_session
Latest commit is for #272 - Added custom compaction functions. Note that in addition to having custom Net462 is supported when using FASTER as binary dependency (e.g. via nuget) however I am embedding sources directly (in addition I sometimes do have more changes) thus locally I've removed |
I think I will do one more change - I want to add an overload to |
…ocating new record during RMW.
I think this PR should not duplicate the async and sync versions, and instead should keep them unified as before. It seems orthogonal to the intent of this PR, correct me if that's not the case. We can consider the issue of better handling the async vs sync state machine in a separate PR. |
@@ -95,15 +95,36 @@ internal class IndexSnapshotTask : ISynchronizationTask | |||
|
|||
if (async && !faster.IsIndexFuzzyCheckpointCompleted()) | |||
{ | |||
clientSession?.UnsafeSuspendThread(); | |||
fasterSession?.UnsafeSuspendThread(); |
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.
will this get inlined?
Hi @marius-klimantavicius, this is a really nicely done PR, thanks for your contribution. I am done with the review and have no other comments than this one. Let me know what you think.
I think this PR should not duplicate the async and sync versions, and instead should keep them unified as before. It seems orthogonal to the intent of this PR, correct me if that's not the case. We can consider the issue of better handling the async vs sync state machine in a separate PR. |
One thing left is to verify that there is no performance regression - have you done some testing in this regard? @TedHartMS - can we use your PerfTest benchmark PR to see the impact of this PR? |
Removed sync methods from state machine (it seems that during my experiments I stopped using sync version after all). As for performance regression - I haven't performed any testing regarding this. Later will try to see if I can use PerfTest for that. |
I tried running PerfTest a few times (I can't find YCSB files so I am using synthetic test only) however I am unable to get stable results on my machine (even with fixed seed for random number generator). I've tried running only a few times (~10-15) as each run (Release build, Ctrl-F5) takes at least 5 minutes. |
What's your machine configuration? The Benchmark test's Release build has a working set around 24GB. The PerfTest app @badrishc referred to is a separate branch and will be available soon. |
I see, I have only 16GB of RAM on this machine maybe it was due swapping (I might try the PerfTest branch a bit later). |
We are noticing a 10% drop in performance on a single thread. BeforeFASTER.benchmark.exe -b 0 -t 1 -n 1 -r 50 -d zipf loading keys from D:\ycsb_files\load_zipf_250M_raw.dat into memory... AfterFASTER.benchmark.exe -b 0 -t 1 -n 1 -r 50 -d zipf |
With a minor update to ClientSession.cs, I was able to restore performance to the same level as before. Please review if the change is ok with you. |
Yep these are absolutely OK (I was hoping |
Yeah, 'new AsyncFasterSession(this)' is the main change that got back the 10%. The other change was just a move to be in the safe side. Thanks again! |
I tried removing and re-adding the |
@marius-klimantavicius: In PR #310, I have extended the builder slightly, to support writing of slightly cleaner code that produces a proper client session with the right generic params (i.e., specific var session = store.For(new MyFunctions()).NewSession<MyFunctions>(...); It is still ugly ( |
For #230.
Not sure about naming (
ISynchronizationListener
).There is at least one breaking change (
ReadAsyncResult
is in different class [different number of type arguments]).For now I duplicated state machine code for sync and async versions, if this is not ideal I can unify into one method again.
Needed to introduce
IClientSession
, but this seems to be one-time call so no harm there.