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

I/O thread Code optimization, reduces the number of OP_WRITE or OP_READ judgments #13184

Open
wants to merge 1 commit into
base: unstable
Choose a base branch
from

Conversation

dupengchuan
Copy link

if there are n clients per thread, the judgment is O(n),this optimization will reduce it to O(1)

@CLAassistant
Copy link

CLAassistant commented Apr 1, 2024

CLA assistant check
All committers have signed the CLA.

@sundb
Copy link
Collaborator

sundb commented Apr 2, 2024

thanks for the minor improvement, but I'm not sure if modern compilers do the optimization for us.
please wait for me to take some time to check it.

Copy link
Collaborator

@sundb sundb left a comment

Choose a reason for hiding this comment

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

this does save judment from the assembly.
although dont see benefit from benchmark, still agree with this change.

@dupengchuan
Copy link
Author

Kindly ping @oranagra @yossigo

@oranagra
Copy link
Member

what are we saving here? moving the if outside the loop, i seriously doubt you'll be able to measure the impact of that (you're welcome to prove otherwise).
if it would have also resulted in drastically cleaner code, i'd consider anyway, but i think it goes the other way (more code).

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.

None yet

4 participants