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

Reduce reliance on promotion operations via container typing #37088

Merged
merged 1 commit into from
Aug 19, 2020

Conversation

timholy
Copy link
Sponsor Member

@timholy timholy commented Aug 17, 2020

While building Julia, we havehad a lot of calls to promote, often with abstract types. This short-circuits most of these by declaring the container type at the outset.

This has one user-visible outcome, improved inference for walkdir.

After my complete PR series is submitted, I'll post some benchmarks here on the impact on building Julia itself. Obviously no one PR accounts for the whole thing, but this one may be as good a place as any to deposit this info.

@timholy timholy added domain:building Build system, or building Julia or its dependencies compiler:latency Compiler latency labels Aug 17, 2020
Copy link
Member

@quinnj quinnj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool stuff!

@timholy
Copy link
Sponsor Member Author

timholy commented Aug 17, 2020

master:

Sysimage built. Summary:
Total ───────  44.593185 seconds 
Base: ───────  18.240267 seconds 40.9037%
Stdlibs: ────  26.351632 seconds 59.0934%
    JULIA usr/lib/julia/sys-o.a
Generating precompile statements... 30/30
Executing precompile statements... 1771/1782
Precompilation complete. Summary:
Total ───────  85.293917 seconds
Generation ──  58.616914 seconds 68.7234%
Execution ───  26.677004 seconds 31.2766%
    LINK usr/lib/julia/sys.so
tim@diva:~/src/julia-master$ ls -l usr/lib/julia/sys.so 
-rwxr-xr-x 1 tim holy 148227920 Aug 17 15:28 usr/lib/julia/sys.so

On a branch that merges all the PRs I've submitted today:

Sysimage built. Summary:
Total ───────  42.541928 seconds 
Base: ───────  17.358497 seconds 40.8033%
Stdlibs: ────  25.181829 seconds 59.193%
    JULIA usr/lib/julia/sys-o.a
Generating precompile statements... 30/30
Executing precompile statements... 1652/1663
Precompilation complete. Summary:
Total ───────  79.426395 seconds
Generation ──  55.432791 seconds 69.7914%
Execution ───  23.993604 seconds 30.2086%
    LINK usr/lib/julia/sys.so
tim@diva:~/src/julia-master$ ls -l usr/lib/julia/sys.so
-rwxr-xr-x 1 tim holy 144046664 Aug 17 15:44 usr/lib/julia/sys.so

So:

  • about 2s faster to build up through precompilation
  • about 6s faster to precompile, with 100 fewer MethodInstances
  • a sysimg that is 3% smaller

Not too shabby for a couple days of digging with Cthulhu.

base/version.jl Outdated Show resolved Hide resolved
While building Julia, we have a *lot* of calls to promote, often
with abstract types. This short-circuits most of these by declaring
the container type at the outset.

This has one user-visible outcome, improved inference for `walkdir`.
@JeffBezanson JeffBezanson merged commit 4c7026c into master Aug 19, 2020
@JeffBezanson JeffBezanson deleted the teh/containers branch August 19, 2020 02:10
simeonschaub pushed a commit to simeonschaub/julia that referenced this pull request Aug 29, 2020
…ng#37088)

While building Julia, we have a *lot* of calls to promote, often
with abstract types. This short-circuits most of these by declaring
the container type at the outset.

This has one user-visible outcome, improved inference for `walkdir`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:latency Compiler latency domain:building Build system, or building Julia or its dependencies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants