Draft
Conversation
Collaborator
Author
|
@fommil Can you try the code from this PR in your application? It turns out that releasing the GIL doesn't appear to help that much in actual testing. In many cases it hurts because the cost of acquiring the GIL doesn't out weigh the cost of the operation being done by the FITS library. |
|
I'm happy to test it out but I'll need some help with that, I'm not strong in python. I'm using the system installed |
Collaborator
Author
|
Hmmmm. I am not sure TBH since you'll need a compiler to build the package. :/ |
beckermr
commented
Nov 28, 2025
beckermr
commented
Dec 9, 2025
wow I didn't expect it to be this much work, thank you so much for looking into this! |
beckermr
commented
Feb 4, 2026
beckermr
commented
Feb 4, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is a retry of #35 and #475.
Instead of trying to release the GIL everywhere, which appears to break things, I am trying to only release for I/O critical operations.To make further progress on better threaded performance, I think we'll need to separate out the cfitsio calls from the python C API calls so we can release the GIL for larger sections of code. My guess is that a bunch of time is being spent on initialization where the code goes back and forth.The approach here is to release the GIL for the biggest blocks of code as practically possible. There are some spots where this is hard because of the way python data structures are used to hold data as it is pulled from fitsio.
With this approach, I am seeing decent threaded performance once you do enough work in each thread. Threaded performance for reads is better than writes on my machine.