-
Notifications
You must be signed in to change notification settings - Fork 2.2k
fix(clang-tidy): Apply performance fixes from clang-tidy #3046
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
Conversation
This is awesome! How much trouble is it for you to apply the exact same process to the smart_holder branch? Background:
Hope:
But:
Also:
Which means if we do master-merge followed by smart_holder-merge-from-master followed by testing, that testing may uncover some things we need to fix on master, so we have to go back and forth through the branches. If it's reasonably automatic to apply your process to both master and smart_holder straightaway, we'd have a more holistic picture. |
Not that much trouble, I'll go ahead and submit a PR there as well. |
Looks like your branch is a day or two behind. Is that easy to fix?
I see clang-tidy fixes in code that I changed yesterday and today.
Could you please turn it into a PR against the smart_holder branch? Then I
could kick off the global testing using my standard workflow.
…On Thu, Jun 17, 2021 at 3:41 PM Aaron Gokaslan ***@***.***> wrote:
@rwgk <https://github.com/rwgk> Results on SH branch:
https://github.com/Skylion007/pybind11/tree/clang-tidy-sh-perf
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3046 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFUZACG7X72LW6IA6LHDADTTJ2X7ANCNFSM464ON7IA>
.
|
Yeah, I am making a new branch with the latest fixes. |
Awesome, that's totally up-to-date. I'm still learning the github ropes. I
don't see a button to create a PR from the branch (like I do in my own
fork). What's the next step for me?
…On Thu, Jun 17, 2021 at 4:59 PM Aaron Gokaslan ***@***.***> wrote:
@rwgk <https://github.com/rwgk> Here you go:
https://github.com/Skylion007/pybind11/tree/clang-tidy-sh-perf-latest
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3046 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFUZACBKXZP2SQ5PVR73GLTTKD63ANCNFSM464ON7IA>
.
|
Opened a PR assuming you want to make it in the main smart-holder branch. If you want to pull it somewhere else here is the dialogue for doing so: https://github.com/pybind/pybind11/compare/master...Skylion007:clang-tidy-sh-perf-latest?expand=1 |
I see it now: #3048
That's what I was hoping for, for some reason it wasn't in the "pulls" list
a few minutes ago. Thanks!!
…On Thu, Jun 17, 2021 at 5:15 PM Aaron Gokaslan ***@***.***> wrote:
Opened a PR assuming you want to make it in the main smart-holder branch.
If you want to pull it somewhere else here is the dialogue for doing so:
https://github.com/pybind/pybind11/compare/master...Skylion007:clang-tidy-sh-perf-latest?expand=1
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3046 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFUZAD6LV2MOFEGPOASLWLTTKF27ANCNFSM464ON7IA>
.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Via #3048 I ran these changes with ASAN, MSAN, and the Google-internal global testing. I'd love to see this merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's actually pretty neat. They all look fine to me, except for one minor change I would have made.
include/pybind11/numpy.h
Outdated
@@ -164,10 +164,10 @@ struct npy_api { | |||
NPY_ULONG_, NPY_ULONGLONG_, NPY_UINT_), | |||
}; | |||
|
|||
typedef struct { | |||
using PyArray_Dims = struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just struct PyArray_Dims
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was here when I got here. Changed.
return expr; \ | ||
}, \ | ||
name(op), is_method(m_base), arg("other")) | ||
#define PYBIND11_ENUM_OP_STRICT(op, expr, strict_behavior) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-format required this change.
include/pybind11/numpy.h
Outdated
@@ -164,7 +164,7 @@ struct npy_api { | |||
NPY_ULONG_, NPY_ULONGLONG_, NPY_UINT_), | |||
}; | |||
|
|||
using PyArray_Dims = struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just curious, when I saw this initially I thought it was something automatically applied, thinking "probably for a good reason". Was that not the case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should have been automatically caught by the github actions tbh, but it wasn't. From modernize-use-using check
Thanks Aaron! |
Description
Suggested changelog entry: