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

@time_imports not showing extension parents #55713

Closed
IanButterworth opened this issue Sep 7, 2024 · 3 comments · Fixed by #55718
Closed

@time_imports not showing extension parents #55713

IanButterworth opened this issue Sep 7, 2024 · 3 comments · Fixed by #55718
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@IanButterworth
Copy link
Sponsor Member

IanButterworth commented Sep 7, 2024

julia> @time_imports using Plots
...
      0.5 ms  LogExpFunctions
      0.3 ms  CompatLinearAlgebraExt
      0.4 ms  StatsAPI

It seems that EXT_PRIMED which @time_imports uses to figure out if the package is an ext and return its parent is empty throughout the load process, which didn't used to be the case. Works on 1.10. Broken on 1.11 too.

parentid = get(EXT_PRIMED, pkg, nothing)

On 1.10

      0.5 ms  Compat
      0.3 ms  Compat → CompatLinearAlgebraExt
      2.1 ms  OrderedCollections

EXT_PRIMED is only populated by _insert_extension_triggers which is only called at the end of everything loading now.

julia> @time_imports using Plots
      0.6 ms  Printf
     15.3 ms  Dates
      0.8 ms  Statistics
               ┌ 3.0 ms SuiteSparse_jll.__init__()
      4.7 ms  SuiteSparse_jll
      0.7 ms  Serialization
               ┌ 4.6 ms SparseArrays.CHOLMOD.__init__() 90.28% compilation time
    192.1 ms  SparseArrays 38.90% compilation time (62% recompilation)
      0.4 ms  SparseArraysExt
      0.5 ms  TOML
      8.2 ms  Preferences
      0.4 ms  PrecompileTools
      0.3 ms  Reexport
      0.3 ms  Scratch
      0.4 ms  RelocatableFolders
      6.5 ms  RecipesBase
     13.6 ms  FixedPointNumbers
               ┌ 0.0 ms ColorTypes.__init__()
     13.0 ms  ColorTypes
     26.4 ms  Colors
      0.5 ms  TensorCore
               ┌ 0.0 ms ColorVectorSpace.__init__()
     26.3 ms  ColorVectorSpace
      4.0 ms  ColorSchemes
     46.8 ms  PlotUtils
     10.3 ms  PlotThemes
               ┌ 1.7 ms OpenLibm_jll.__init__()
      3.5 ms  OpenLibm_jll
      0.4 ms  NaNMath
     18.9 ms  RecipesPipeline
      0.4 ms  UUIDs
               ┌ 0.0 ms Requires.__init__()
      0.5 ms  Requires
     24.3 ms  StyledStrings
               ┌ 0.0 ms JuliaSyntaxHighlighting.__init__()
      8.2 ms  JuliaSyntaxHighlighting
               ┌ 0.0 ms Markdown.__init__()
      3.3 ms  Markdown
      1.4 ms  InteractiveUtils
               ┌ 0.0 ms REPL.REPLCompletions.__init__()
               ├ 0.0 ms REPL.__init__()
     54.1 ms  REPL
      1.8 ms  UnicodeFun
      0.8 ms  DataAPI
      0.4 ms  Compat
     24.5 ms  OrderedCollections
     15.3 ms  DataStructures
      0.8 ms  SortingAlgorithms
      2.1 ms  Missings
               ┌ 0.0 ms NetworkOptions.__init__()
      1.3 ms  NetworkOptions
               ┌ 1.1 ms MbedTLS_jll.__init__()
      3.2 ms  MbedTLS_jll
               ┌ 0.5 ms LibSSH2_jll.__init__()
      2.2 ms  LibSSH2_jll
               ┌ 0.8 ms LibGit2_jll.__init__()
      2.5 ms  LibGit2_jll
      9.7 ms  LibGit2
               ┌ 0.0 ms DocStringExtensions.__init__()
      1.0 ms  DocStringExtensions
      6.1 ms  IrrationalConstants
      0.5 ms  LogExpFunctions
      0.3 ms  CompatLinearAlgebraExt
      0.4 ms  StatsAPI
      9.6 ms  StatsBase
      5.6 ms  ArgTools
               ┌ 0.4 ms nghttp2_jll.__init__()
      2.1 ms  nghttp2_jll
               ┌ 0.7 ms LibCURL_jll.__init__()
      2.4 ms  LibCURL_jll
               ┌ 0.0 ms MozillaCACerts_jll.__init__()
      1.7 ms  MozillaCACerts_jll
               ┌ 0.0 ms LibCURL.__init__()
      1.2 ms  LibCURL
               ┌ 1.9 ms Downloads.Curl.__init__()
     14.2 ms  Downloads
      0.5 ms  Showoff
      2.3 ms  Unzip
      0.5 ms  JLLWrappers
               ┌ 132.1 ms fzf_jll.__init__() 99.84% compilation time (7% recompilation)
    132.9 ms  fzf_jll 99.27% compilation time (7% recompilation)
      0.5 ms  Pipe
      0.5 ms  JLFzf
      0.8 ms  Mmap
               ┌ 0.0 ms Parsers.__init__()
     17.0 ms  Parsers
      7.1 ms  JSON
      1.7 ms  Measures
               ┌ 0.6 ms Bzip2_jll.__init__()
      1.2 ms  Bzip2_jll
               ┌ 3.1 ms Zlib_jll.__init__()
      4.9 ms  Zlib_jll
               ┌ 0.6 ms FreeType2_jll.__init__()
      1.2 ms  FreeType2_jll
               ┌ 0.5 ms FriBidi_jll.__init__()
      1.1 ms  FriBidi_jll
               ┌ 0.9 ms Libiconv_jll.__init__()
      1.4 ms  Libiconv_jll
               ┌ 0.4 ms Libffi_jll.__init__()
      1.0 ms  Libffi_jll
               ┌ 12.1 ms CompilerSupportLibraries_jll.__init__()
     13.9 ms  CompilerSupportLibraries_jll
               ┌ 0.7 ms XML2_jll.__init__()
      1.4 ms  XML2_jll
               ┌ 1.2 ms Gettext_jll.__init__()
      1.8 ms  Gettext_jll
               ┌ 3.4 ms PCRE2_jll.__init__()
      5.1 ms  PCRE2_jll
               ┌ 4.9 ms Glib_jll.__init__()
      5.5 ms  Glib_jll
               ┌ 0.9 ms LLVMOpenMP_jll.__init__()
      1.5 ms  LLVMOpenMP_jll
               ┌ 0.5 ms Pixman_jll.__init__()
      1.1 ms  Pixman_jll
               ┌ 0.5 ms libpng_jll.__init__()
      1.1 ms  libpng_jll
      0.4 ms  Libuuid_jll
               ┌ 0.5 ms Expat_jll.__init__()
      1.1 ms  Expat_jll
               ┌ 7.4 ms Fontconfig_jll.__init__() 89.55% compilation time (17% recompilation)
      8.4 ms  Fontconfig_jll 78.89% compilation time (17% recompilation)
               ┌ 2.0 ms Cairo_jll.__init__()
      2.7 ms  Cairo_jll
               ┌ 0.6 ms Graphite2_jll.__init__()
      1.2 ms  Graphite2_jll
               ┌ 2.1 ms HarfBuzz_jll.__init__()
      2.8 ms  HarfBuzz_jll
               ┌ 0.7 ms libass_jll.__init__()
      1.4 ms  libass_jll
               ┌ 0.5 ms libfdk_aac_jll.__init__()
      1.2 ms  libfdk_aac_jll
               ┌ 0.6 ms LAME_jll.__init__()
      1.2 ms  LAME_jll
               ┌ 0.5 ms Ogg_jll.__init__()
      1.2 ms  Ogg_jll
               ┌ 1.6 ms libvorbis_jll.__init__()
      2.3 ms  libvorbis_jll
               ┌ 0.7 ms libaom_jll.__init__()
      1.4 ms  libaom_jll
               ┌ 0.8 ms x264_jll.__init__()
      1.5 ms  x264_jll
               ┌ 0.8 ms x265_jll.__init__()
      1.5 ms  x265_jll
               ┌ 1.8 ms OpenSSL_jll.__init__()
      2.5 ms  OpenSSL_jll
               ┌ 0.6 ms Opus_jll.__init__()
      1.3 ms  Opus_jll
               ┌ 9.5 ms FFMPEG_jll.__init__()
     10.4 ms  FFMPEG_jll
      0.8 ms  FFMPEG
               ┌ 1.0 ms GLFW_jll.__init__()
      1.7 ms  GLFW_jll
               ┌ 1.2 ms JpegTurbo_jll.__init__()
      2.0 ms  JpegTurbo_jll
               ┌ 0.8 ms LERC_jll.__init__()
      1.6 ms  LERC_jll
               ┌ 0.7 ms XZ_jll.__init__()
      1.6 ms  XZ_jll
               ┌ 0.7 ms Zstd_jll.__init__()
      1.4 ms  Zstd_jll
               ┌ 0.8 ms Libtiff_jll.__init__()
      1.6 ms  Libtiff_jll
      0.6 ms  libinput_jll
      0.6 ms  Xorg_libXext_jll
      0.6 ms  Xorg_libxcb_jll
      0.6 ms  Xorg_xcb_util_wm_jll
      0.6 ms  Xorg_xcb_util_cursor_jll
      0.6 ms  Xorg_xcb_util_image_jll
      0.6 ms  Xorg_xcb_util_keysyms_jll
      0.6 ms  Xorg_xcb_util_renderutil_jll
      0.6 ms  Xorg_libXrender_jll
      0.6 ms  Xorg_libSM_jll
      0.6 ms  xkbcommon_jll
      0.6 ms  Libglvnd_jll
               ┌ 0.8 ms Vulkan_Loader_jll.__init__()
      1.5 ms  Vulkan_Loader_jll
               ┌ 16.8 ms Qt6Base_jll.__init__()
     17.7 ms  Qt6Base_jll
               ┌ 0.1 ms GR_jll.__init__()
      1.1 ms  GR_jll
      1.4 ms  Tar
               ┌ 0.0 ms p7zip_jll.__init__()
      3.1 ms  p7zip_jll
               ┌ 88.9 ms GR.GRPreferences.__init__() 99.92% compilation time (100% recompilation)
    102.7 ms  GR 86.48% compilation time (100% recompilation)
               ┌ 2.3 ms Plots.__init__() 90.98% compilation time (100% recompilation)
    259.3 ms  Plots 0.80% compilation time (100% recompilation)
[ Info: _insert_extension_triggers
[ Info: _insert_extension_triggers
[ Info: _insert_extension_triggers
[ Info: _insert_extension_triggers
[ Info: _insert_extension_triggers
@IanButterworth IanButterworth added the bug Indicates an unexpected problem or unintended behavior label Sep 7, 2024
@IanButterworth
Copy link
Sponsor Member Author

@KristofferC I tried to fix this but I got lost in the loading sequencing. Is there another way to tell that they are extensions?

@KristofferC
Copy link
Sponsor Member

Perhaps look at pkgdir and see if it is in an ext folder or something ugly like that...

@IanButterworth
Copy link
Sponsor Member Author

It seems like pkgorigins isn't set yet for the packages at that point because register_root_module is called conditionally after _include_from_serialized returns.

I could try passing that condition into _include_from_serialized so it can be done just before the print.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants