Skip to content

perf: Add more moves and optimize #3845

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

Merged

Conversation

Skylion007
Copy link
Collaborator

@Skylion007 Skylion007 commented Apr 2, 2022

Description

This PR fixes a couple of things:

  1. Use member initializers even more aggressively in pytypes.h to remove the need to default initialize m_ptr to null.
  2. Apply a bunch of missing std::moves to prevent unecessary pointer increments and decrements
  3. Adds a missing a perfect forwarding in a constructor.

Suggested changelog entry:

* Made slice constructor more consistent
* Improve performance of some casters by allowing reference stealing.

@Skylion007 Skylion007 requested review from rwgk and henryiii April 2, 2022 16:19
@Skylion007 Skylion007 changed the title Make slice constructor consistent (perf): Add more moves and optimize Apr 2, 2022
@Skylion007 Skylion007 changed the title (perf): Add more moves and optimize perf: Add more moves and optimize Apr 3, 2022
@Skylion007 Skylion007 merged commit c4e2952 into pybind:master Apr 5, 2022
@Skylion007 Skylion007 deleted the skylion007-make-slice-ctor-consistent branch April 5, 2022 18:36
@github-actions github-actions bot added the needs changelog Possibly needs a changelog entry label Apr 5, 2022
@henryiii henryiii removed the needs changelog Possibly needs a changelog entry label Jul 9, 2022
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