Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tag some inexpensive, frequently called methods with the HoldGIL anno…
…tation This prevents the Python GIL from being released before calling the method (which is the default behaviour). For very cheap to call c++ methods the cost of releasing the GIL can outweigh the cost of the c++ call, which means it's more efficient to retain the hold on the GIL. Ideally we'd do this everywhere, and switch to an explicit ReleaseGIL annotation on functions which are slow or risky (raise exceptions, or do something which can cause a GIL deadlock). But those are very tricky to identify, so instead just explicitly hold the gil on cheap methods which are likely to be called many times and could have an impact on script performance.
- Loading branch information
1 parent
cc70b9f
commit d4a2ddd
Showing
8 changed files
with
154 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.