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

Prevent extensions from blocking parallel pre-compilation #55910

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

topolarity
Copy link
Member

@topolarity topolarity commented Sep 27, 2024

Previously our precompilation code was causing anything with package A as a dependency to wait on all of A's extensions and weakdeps to finish before starting to pre-compile, even if it can't actually load those weakdeps (or the extensions themselves)

This would lead to a pre-compile ordering like:

A        B
 \      / \
  Ext AB   \
     |     /
     C    /
      \  /
       D

Here C cannot pre-compile in parallel with Ext {A,B} and B, because it has to wait for Ext {A,B} to finish pre-compiling. That happens even though C has no way to load either of these.

This change updates the pre-compile ordering to be more parallel, reflecting the true place where Ext {A,B} can be loaded:

  A       B
 / \     / \
C   Ext AB  |
 \    |    /
  \-- D --/

which allows C to compile in parallel with B and Ext{A,B}

Please review 55b40ed (that's the only commit w/ important changes)

@topolarity topolarity added backport 1.10 Change should be backported to the 1.10 release backport 1.11 Change should be backported to release-1.11 labels Sep 27, 2024
@KristofferC KristofferC mentioned this pull request Sep 30, 2024
39 tasks
Previously our precompilation code was causing any dependencies of a
package A to wait on all of A's weakdeps to finish pre-compiling,
even if it can't actually load those weakdeps (or the extension itself)

This would lead to a pre-compile ordering like:
```
A        B
 \      / \
  Ext AB   \
     |     /
     C    /
      \  /
       D
```

Here, extension `C` cannot pre-compile in parallel with `Ext {A,B}` and
`B`, because it has to wait for `Ext {A,B}` to finish pre-compiling.
That happens even though `C` has no way to load either of these.

This change updates the pre-compile ordering to be more parallel,
reflecting the true place where `Ext {A,B}` can be loaded:
```
  A       B
 / \     / \
C   Ext AB  |
 \    |    /
  \-- D --/
```

which allows `C` to compile in parallel with `B` and `Ext{A,B}`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 1.10 Change should be backported to the 1.10 release backport 1.11 Change should be backported to release-1.11
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant