Closed PallHaraldsson closed 3 years ago
You still have Python.jl installed from before the name change. It has the same UUID, so I imagine that is the problem. I think the error message has a bug though, in that Julia should report the old name of the package.
Thanks for looking at startup time. It's definitely something I want to improve. I believe the main contributors are (a) time spent compiling methods for the juliacall.*Value types, and (b) time spent compiling conversion rules. These both compile C functions which is quite slow in Julia. These are both compiled when used, but the init function uses some of them. The ones in (a) could be more lazy - we compile all methods for a type the first time the type is used. Might be possible to compile each method on first use. In (b) I use C functions as an optimisation, which speeds up conversion but has a JIT cost. This could be reverted, or JITed in the background perhaps. Would be good to take a proper look with SnoopCompile but I don't have time right now.
As well as precompile, nospecialize and optlevel may be useful.
Just committed some time-savers:
Base.convert(::Type, ::PyObject)
generated a lot of method invalidations. Removing it saved 2 seconds.Just saved another 4-5 seconds by precompiling the init function! Now ~7.5 seconds.
SnoopCompile suggests we can get another 2 seconds by precompiling some things to do with the juliacall.*Value
types.
Closing this as it's about a previous incarnation of the package.
Hi, I CAN install your package on a clean install (not otherwise, see below), but as you know startup is rather slow.
A. I added precompile statements and got down to (still higher than what I would like to see):
compared to your package as is:
I used a naive way, not SnoopCompile.jl, so maybe it's better. I'm also thinking, do you need to do this much at init? Can you postpone some things, and do later lazily?
B. The above worked with the new Julia 1.6.0-rc2, but with my original .julia folder I get (on that version and later, including 1.53):
Do you have any idea what it means (this is before my work with precompile statements)?
At least I thought you would like to know, as your users might encounter this, and I have no idea where to begin to debug this. Except, while it doesn't seem to strictly be about your package (or is it?), only an interaction with my (broken?) setup: