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 dispatch for fused memoryview types #5073

Merged
merged 11 commits into from Jan 12, 2023
Merged

Conversation

da-woods
Copy link
Contributor

@da-woods da-woods commented Oct 9, 2022

By converting them to a memoryview once, checking some of the
details of that, and then using that to initialize the
Cython memoryview.

Also closes #3798 as an implementation detail.

I measure something like ~7% speedup on a small toy example
that selects between 3 types of memoryviews

By converting them to a memoryview once, checking some of the
details of that, and then using that to initialize the
Cython memoryview.

Also closes cython#3798 as an implementation detail.

I measure something like ~7% speedup on a small toy example
that selects between 3 types of memoryviews
@da-woods da-woods marked this pull request as draft October 9, 2022 12:14
@da-woods
Copy link
Contributor Author

da-woods commented Oct 9, 2022

Draft because it's broken PyPy2

Cython/Compiler/FusedNode.py Outdated Show resolved Hide resolved
I wasn't able to diagnose what's going on, but it doesn't
work if you go via an intermediate Python memoryview
Doesn't need special utility code
@da-woods da-woods marked this pull request as ready for review October 10, 2022 05:48
@scoder scoder added this to the 3.0 milestone Jan 12, 2023
@scoder scoder merged commit 805d7f3 into cython:master Jan 12, 2023
@scoder
Copy link
Contributor

scoder commented Jan 12, 2023

Cool, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ENH] Builtin type support for memoryview
3 participants