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

import FilePaths harmful for load time #4842

Open
3 tasks done
jaakkor2 opened this issue Mar 4, 2025 · 3 comments · May be fixed by #4863
Open
3 tasks done

import FilePaths harmful for load time #4842

jaakkor2 opened this issue Mar 4, 2025 · 3 comments · May be fixed by #4863
Labels

Comments

@jaakkor2
Copy link
Contributor

jaakkor2 commented Mar 4, 2025

  • what version of Makie are you running? (]st -m Makie)
Status `C:\Users\jaakkor2\MyTemp\debug\Project.toml`
  [8bb1440f] DelimitedFiles v1.9.1
  [cd3eb016] HTTP v1.10.15
  [ee78f7c6] Makie v0.22.2 `C:\Users\jaakkor2\.julia\dev\Makie`
  [477bde09] MyDebugPkg v1.0.0-DEV `C:\Users\jaakkor2\.julia\dev\MyDebugPkg`
  [bca83a33] OptimizationBase v2.4.0
  • can you reproduce the bug with a fresh environment ? (]activate --temp; add Makie)
  • What platform + GPU are you on? WIndows 11, Intel i7-1370P with integrated GPU

On Julia v"1.12.0-DEV.2047" (1.12-nightly in juliaup), a package with only these lines shows considerably longer using times due to import of FilePaths in Makie.

module MyDebugPkg

import HTTP
import DelimitedFiles
import OptimizationBase
using Makie

end

Commenting out line https://github.com/MakieOrg/Makie.jl/blob/v0.22.2/src/Makie.jl#L15-L19

import FilePaths

improves usage time considerably, @time using MyDebugPkg outputs

master

  6.175683 seconds (9.32 M allocations: 499.577 MiB, 5.25% gc time, 23.91% compilation time: 79% of which was recompilation)

without FilePaths

  4.779248 seconds (7.07 M allocations: 381.341 MiB, 6.74% gc time, 1.56% compilation time: 65% of which was recompilation)

Makie is the only user of FilePaths

(debug) pkg> why FilePaths
  Makie → FilePaths
  MyDebugPkg → Makie → FilePaths

Related report on Electron was filed, but closed davidanthoff/Electron.jl#128.

@jaakkor2 jaakkor2 added the bug label Mar 4, 2025
@jkrumbiegel
Copy link
Member

Huh yeah this is not good. Of course we only have it due to Electron having it, but I don't think we should penalize CairoMakie and GLMakie users that much for something which only affects WGLMakie...

@SimonDanisch
Copy link
Member

Oh wow, didn't realize the impact was that big....
Maybe someone can invest some time into fixing Electron... I'm quite sure that it's not absolutely necessary, or could just extract a few of the functions from FilePaths.

@jaakkor2
Copy link
Contributor Author

jaakkor2 commented Mar 11, 2025

With FilePaths v0.9 I do not observe penalty from import FilePaths. This is with Julai Version 1.12.0-DEV.2047 (2025-02-26).

julia> @time using MyDebugPkg
  4.813101 seconds (6.85 M allocations: 383.050 MiB, 6.64% gc time, 2.47% compilation time: 67% of which was recompilation)
``´

@jaakkor2 jaakkor2 linked a pull request Mar 11, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants