Skip to content
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

Possible performance regression in 3.5.0 #3677

Closed
lbialy opened this issue Jun 11, 2023 · 7 comments · Fixed by #3690
Closed

Possible performance regression in 3.5.0 #3677

lbialy opened this issue Jun 11, 2023 · 7 comments · Fixed by #3690

Comments

@lbialy
Copy link

lbialy commented Jun 11, 2023

There's some discussion regarding the possible performance regression between 3.4.x and 3.5.0 found by Flavio Brasil. More information (including flame charts) can be found in his tweets here and replies in threads underneath it:

https://twitter.com/fbrasisil/status/1667798762788646912

Is it a regression or is it a part of the plan for I/O polling?

@djspiewak
Copy link
Member

So basically, this is known, but we were planning on lazily-evaluating the optimization options when someone complains. :-) In 3.5.0, we call System.nanoTime() on each step of the WorkerThread loop. This gives us amazing timer granularity (far better than 3.4.x and prior), but it's also somewhat costly. Our benchmarks suggested that it wasn't much of a problem outside of microbenchmarks, so we left it alone to see if anyone would complain.

The easy optimization is to shift it into just state 0 of the worker. This would cause our timer granularity to get a bit worse, but still better than pre-3.5, and it would reduce the amortized cost of the syscall by a factor of 64. So… probably worth it? Not at all hard to do, we just didn't.

Call for opinions! Anyone have strong feelings about this one way or another?

@armanbilge
Copy link
Member

armanbilge commented Jun 11, 2023

Cross-linking to:

@lbialy
Copy link
Author

lbialy commented Jun 12, 2023

Thanks for the explanation @djspiewak! I'll leave the issue open so that it's easy to find should anyone actually have a production issue with this.

@alexandru
Copy link
Member

Speaking of System.nanoTime, not familiar with how that works, but it seems like a system call, and system calls can be unpredictable. It might be worth some optimization, if possible; even if microbenchmarks are not necessarily a reason for concern. Just an uninformed opinion/feeling at this point.

@djspiewak
Copy link
Member

It is indeed a syscall. :-) It delegates to gettime on most platforms.

@SethTisue
Copy link
Member

SethTisue commented Jul 7, 2023

Should this be closed, since #3690 was merged?

@armanbilge
Copy link
Member

armanbilge commented Jul 7, 2023

GitHub doesn't auto-close issues if the PRs are not merged to the default branch...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants