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

[grid] improved the new session handling when the queue is empty #12385

Merged
merged 2 commits into from
Jul 21, 2023

Conversation

joerg1985
Copy link
Member

Description

This PR implements two strategies to reduce the overhead of the new session runnable:

  • peek into the a local queue to avoid collecting stereotypes when the queue is empty.
  • ensure all slots share the same stereotype instance to hit the fast-path in .equals

Motivation and Context

A idle selenium server will check the session queue each 10ms, therefore the stereotypes of the slots need to be collected. This will make the idle server not really idle, this can be observed when profiling the GC or looking at the power consumption of an VM. The more cores/threads the system has available, the more slots need to be collected, the more garage is generated.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@codecov-commenter
Copy link

Codecov Report

Patch and project coverage have no change.

Comparison is base (b543555) 57.28% compared to head (fe8de05) 57.28%.

❗ Current head fe8de05 differs from pull request most recent head 3a4b19a. Consider uploading reports for the commit 3a4b19a to get more accurate results

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@           Coverage Diff           @@
##            trunk   #12385   +/-   ##
=======================================
  Coverage   57.28%   57.28%           
=======================================
  Files          86       86           
  Lines        5333     5333           
  Branches      193      193           
=======================================
  Hits         3055     3055           
  Misses       2085     2085           
  Partials      193      193           

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@joerg1985 joerg1985 requested a review from diemol July 20, 2023 20:01
@joerg1985
Copy link
Member Author

@diemol this PR will avoid the lookup in a remote queue and still improve the situation with a local queue.
Is this better than in the original #12336 where the queue was always queried?

Copy link
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this solution is a very good idea. Thank you, @joerg1985!

@diemol diemol merged commit b22d08d into SeleniumHQ:trunk Jul 21, 2023
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 this pull request may close these issues.

3 participants