-
Notifications
You must be signed in to change notification settings - Fork 32
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
Comparing to minstant
#63
Comments
Hi there! I've actually looked at I'll start with calibration delay. I wouldn't be against a PR that switches the global calibration to automatically run at process start. This one seems like the easiest to achieve in a cross-platform way given As far as per-CPU core deviation: you're right, My main reservation with adding such logic is that it should ideally be cross-platform, so ff the top of my head, we would need:
That gets us a way to do the calibration on a per-CPU basis, although the value of TSC_AUX is still OS-dependent, so we could store per-CPU offsets for Linux, but nothing else.. so we'd probably end up mirroring what All of this is a long way of saying: I think I'm definitely open to PRs to try and incrementally improve the situation, but I'm not sure if I would personally be able to get these types of changes in a timeframe of anything less than multiple months. |
Thanks for your quick reply! I think we can't wait for multiple months. But why will it take that long as you have mentioned that |
It wouldn't take multiple months of work, just that given the time I'm able to allocate to my open-source projects and the effort to implement and test these things to satisfactory level would likely end up taking me a few months. (edited because my original response was unintentionally harsh.) |
Oh, I've just misunderstood. I thought you were saying it'll take several months to review the PR. Definitely, we'd like to make a PR but we've decided to stick with |
No worries. My response was unintentionally harsh and I've edited it. Sorry about that. Hopefully, whenever it happens, you/me/we/whoever can work on this stuff and get it into |
After fixing #82, I checked also
It doesn't have problems with contention, but numbers differ from benchmarks in minstant's repository for basic cases for my CPU (AMD Ryzen 7 4800HS), that's interesting. Also, |
Note: Thus, a better way to measure performance is to measure AMD Ryzen 7 4800HS let start = QuantaInstant::now();
QuantaInstant::now() - start
quanta v0.12.1 (scales once, but less ergonomic API): let start = clock.raw();
clock.delta(start, clock.raw())
minstant 0.1.4 (scales once) let start = MinstantInstant::now();
MinstantInstant::now() - start
So, now minstant is better in terms of performance. If talking about functional comparison:
For the last point, let's consider a situation where we just want to check whether some time has elapsed or not. let deadline = Instant::now() + Duration::from_secs(2) // stores ticks and then checks against it multiple times: Instant::now() >= deadline // no scaling at all In quanta, it seems impossible because there is no time -> ticks conversion, only ticks -> time. Thus, the scaling will happen in any case. Although delta can be used to calculate scale, it's an implementation detail. |
That's a good comparison. I'm not sure we could make a change to defer the scaling arithmetic unless we also included the scaling factor/shift in |
I'm too. For instance, I have both cases: one However, I think let start = clock.raw();
clock.delta(start, clock.raw()) Otherwise, it requires manual Will you accept |
Hi, I'm one of the authors of
minstant
, andminitrace
based onminstant
which is a fast tracing library used byTiKV
. Similar toquanta
,minstant
is also based on the TSC. I'm considering migratingminitrace
to usequanta
but have found some blocking problems, which are:quanta
doesn't handle TSC deviation on the CPU cores. This problem can occur on some AMD chips. Inminstant
, the calibration will be executed on every core, and a correction for each core will be calculated once the deviation is detected.minstant
,rust-ctor
helps start the calibration at the start of the process.Are these two problems possible to be fixed?
The text was updated successfully, but these errors were encountered: