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

Can PyYAML benefit from PEP 703 (making the GIL optional)? #718

Open
gabrieldemarmiesse opened this issue Jun 22, 2023 · 0 comments
Open

Comments

@gabrieldemarmiesse
Copy link

Hi!

I'm Gabriel de Marmiesse and I'm helping Sam Gross to find out if maintainers of selected Python packages would benefit from PEP703.

If you don't know what is PEP 703, it's about making the global interpreter lock (GIL) optional.
Long story short, there would be a ~10% performance impact on single threaded programs, but would allow multithreaded programms to take full advantage of multiple cores.
You can play with it here.

If you have the time, we would like to know is if the maintainers of PyYAML would benefit from PEP 703 or not. There are multiple situation PyYAML could be in.

  1. PyYAML already uses threads and PEP 703 will likely make some features faster by allowing parallelization of cpu computation without any change.
  2. PyYAML doesn't use threads, but PEP 703 would allow you to rewrite some features with multithreading, thus making it faster.
  3. PyYAML uses multithreading with a low-level language (rust, C, C++...) or multiprocessing and using PEP 703 would allow a rewrite and lower the maintenance burden.
  4. There is no computation that can be parallelized.
  5. PyYAML wouldn't use multithreading, but it's very likely that users will call this package functions and classes from multiple threads because the workload can often be parralelized.

The Python language could never use multiple cores with multithreading, so it's hard to imagine what the future of the language would look like if we were to enable it. Feel free to tell us if you see new potential use cases with this PEP. Thanks for your time!

If you want to know more about PEP 703:

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

No branches or pull requests

1 participant