diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ad07fa2..dc3dbfd0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## Unreleased +* Improved TTFX in JuliaCall. * Minimum supported Python version is now 3.11. ## 0.9.37 (2026-10-12) diff --git a/src/JlWrap/any.jl b/src/JlWrap/any.jl index 96a6a3d2..c0a4244c 100644 --- a/src/JlWrap/any.jl +++ b/src/JlWrap/any.jl @@ -21,6 +21,8 @@ function pyjlany_getattr(self, k_::Py) Py(getproperty(self, k)) end pyjl_handle_error_type(::typeof(pyjlany_getattr), self, exc) = pybuiltins.AttributeError +# `jl.` on `juliacall.Main` is often the first call of a JuliaCall session. +precompile(pyjlany_getattr, (Module, Py)) function pyjlany_setattr(self, k_::Py, v_::Py) k = Symbol(pyjl_attr_py2jl(pyconvert(String, k_))) diff --git a/src/JlWrap/module.jl b/src/JlWrap/module.jl index 2f636e08..5fb1aa8f 100644 --- a/src/JlWrap/module.jl +++ b/src/JlWrap/module.jl @@ -12,6 +12,8 @@ end function pyjlmodule_seval(self::Module, expr::Py) Py(Base.eval(self, Meta.parseall(strip(pyconvert(String, expr))))) end +# `jl.seval(...)` is often the first call of a JuliaCall session. +precompile(pyjlmodule_seval, (Module, Py)) function init_module() jl = pyjuliacallmodule