Skip to content

Conversation

NHDaly
Copy link
Member

@NHDaly NHDaly commented Sep 6, 2025

PR Description

Backports JuliaLang#59366.


In --trace-compile Tag nested precompiles with # nested_compile.

Before:

  ./usr/bin/julia --startup=no --trace-compile=stderr -e '
    Base.@assume_effects :foldable function nested1(x)
        sum(collect(x for _ in 1:10_000_000))
    end
    f1(x) = nested1(sizeof(x)) + x
    f1(2)'
  precompile(Tuple{typeof(Main.nested1), Int64})
  precompile(Tuple{typeof(Main.f1), Int64})

  ./usr/bin/julia --startup=no --trace-compile=stderr --trace-compile-timing -e '
    Base.@assume_effects :foldable function nested1(x)
        sum(collect(x for _ in 1:10_000_000))
    end
    f1(x) = nested1(sizeof(x)) + x
    f1(2)'
  #=    8.1 ms =# precompile(Tuple{typeof(Main.nested1), Int64})
  #=   71.3 ms =# precompile(Tuple{typeof(Main.f1), Int64})

After:

  ./usr/bin/julia --startup=no --trace-compile=stderr -e '
    Base.@assume_effects :foldable function nested1(x)
        sum(collect(x for _ in 1:10_000_000))
    end
    f1(x) = nested1(sizeof(x)) + x
    f1(2)'
  precompile(Tuple{typeof(Main.nested1), Int64}) # nested_const_compilation
  precompile(Tuple{typeof(Main.f1), Int64})

  ./usr/bin/julia --startup=no --trace-compile=stderr --trace-compile-timing -e '
    Base.@assume_effects :foldable function nested1(x)
        sum(collect(x for _ in 1:10_000_000))
    end
    f1(x) = nested1(sizeof(x)) + x
    f1(2)'
  #=    8.1 ms =# precompile(Tuple{typeof(Main.nested1), Int64}) # nested_const_compilation
  #=   71.3 ms =# precompile(Tuple{typeof(Main.f1), Int64})

Checklist

Requirements for merging:

@NHDaly NHDaly added port-to-v1.12 This change should apply to Julia v1.12 builds and removed port-to-master port-to-v1.10 labels Sep 6, 2025
Copy link

github-actions bot commented Oct 7, 2025

This PR is stale because it has been open 30 days with no activity. Comment or remove stale label, or this PR will be closed in 5 days.

@github-actions github-actions bot added the stale This pull request is inactive label Oct 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
port-to-v1.12 This change should apply to Julia v1.12 builds stale This pull request is inactive
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant