Skip to content

Backport: In --trace-compile Tag nested precompiles with # nested const compilation. (#59366)#252

Closed
NHDaly wants to merge 1 commit into
v1.10.2+RAIfrom
nhd-backport-59366
Closed

Backport: In --trace-compile Tag nested precompiles with # nested const compilation. (#59366)#252
NHDaly wants to merge 1 commit into
v1.10.2+RAIfrom
nhd-backport-59366

Conversation

@NHDaly
Copy link
Copy Markdown
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
@github-actions
Copy link
Copy Markdown

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
@github-actions github-actions Bot closed this Oct 12, 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