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

Optimize clippy trivially_copy_pass_by_ref for 64-bit. #909

Merged
merged 1 commit into from
May 9, 2020

Conversation

xStrom
Copy link
Member

@xStrom xStrom commented May 9, 2020

This PR changes trivially_copy_pass_by_ref to 16 bytes, which is the number of bytes that fit into two 64-bit CPU registers.

The default clippy value for this is 8 bytes, which is chosen to improve performance on 32-bit. Given that druid is being designed for the future and already even mobile phones have 64-bit CPUs, it makes sense to optimize for 64-bit and accept the performance hits on 32-bit.

This also changes command Target to be passed by value. It's a breaking change, but given that commands are getting redone in #908 anyway, I think this is about as perfect of a time to change this as possible.

@xStrom xStrom added maintenance cleans up code or docs S-needs-review waits for review breaking change pull request breaks user code labels May 9, 2020
Copy link
Collaborator

@luleyleo luleyleo left a comment

Choose a reason for hiding this comment

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

Thanks a lot for your help in figuring this out 😄
And I have a language question again.

@@ -0,0 +1,5 @@
# The default clippy value for this is 8 bytes, which is chosen to improve performance on 32-bit.
# Given that druid is being designed for the future and already even mobile phones have 64-bit CPUs,
Copy link
Collaborator

Choose a reason for hiding this comment

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

and already even mobile phones have 64-bit CPUs

Is it correct to place already there?

and even mobile phones already have 64-bit CPUs

feels better to me.

Copy link
Member Author

Choose a reason for hiding this comment

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

Both are fine and you could even put it at the end. Check out this Cambridge dictionary page about it.

@xStrom xStrom removed the S-needs-review waits for review label May 9, 2020
@xStrom xStrom merged commit 3a80b63 into linebender:master May 9, 2020
@xStrom xStrom deleted the clippy-conf branch May 9, 2020 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change pull request breaks user code maintenance cleans up code or docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants