Skip to content

Conversation

@neutrinoceros
Copy link
Member

PR Summary

Since I'm spending a lot of time looking at wheels build logs I noticed we had a handful of warnings similar to:

performance hint: yt/geometry/grid_visitors.pyx:20:0: Exception check on 'free_tuples' will always require the GIL to be acquired.
Possible solutions:
	1. Declare 'free_tuples' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
	2. Use an 'int' return type on 'free_tuples' to allow an error code to be returned.

This fixes these. Some performance improvement is also excepted as a result, though I do not know of a realistic benchmark I could use to quantify it.

PR Checklist

  • New features are documented, with docstrings and narrative docs
  • Adds a test for any bugs fixed. Adds tests for new features.

@neutrinoceros neutrinoceros added this to the 4.4.2 milestone Jul 28, 2025
@neutrinoceros neutrinoceros added bug enhancement Making something better performance build related to the build process and removed bug labels Jul 28, 2025
@neutrinoceros neutrinoceros marked this pull request as ready for review July 28, 2025 18:56
@neutrinoceros neutrinoceros merged commit 5c3b3dd into yt-project:main Jul 28, 2025
11 of 12 checks passed
@neutrinoceros neutrinoceros deleted the bld/missing-noexcept-qual branch July 28, 2025 19:12
meeseeksmachine pushed a commit to meeseeksmachine/yt that referenced this pull request Jul 28, 2025
…ers to Cython functions already declared as `nogil`
neutrinoceros added a commit that referenced this pull request Jul 28, 2025
…7-on-yt-4.4.x

Backport PR #5237 on branch yt-4.4.x (BLD/PERF: add missing `noexcept` qualifiers to Cython functions already declared as `nogil`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build related to the build process enhancement Making something better performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants