Skip to content

774 v2#779

Merged
cjdoris merged 4 commits into
mainfrom
774-v2
May 24, 2026
Merged

774 v2#779
cjdoris merged 4 commits into
mainfrom
774-v2

Conversation

@cjdoris
Copy link
Copy Markdown
Member

@cjdoris cjdoris commented May 24, 2026

Alternative version of #774.

In this version we just add one new option lib and re-use the existing bindir option.

We have sensible discovery/defaults:

  • If exe is not set but bindir is, then set exe={bindir}/julia.
  • If lib is not set, then launch a julia subprocess (as we did unconditionally before) to find it. Also find bindir if not set.
  • If bindir is not set, then set it to the directory containing exe.

Hence setting exe (or bindir) and lib is sufficient to avoid the julia subprocess.

ncudlenco and others added 3 commits May 18, 2026 23:53
…very subprocess

init() starts a short-lived Julia process solely to print libjulia's
path and Sys.BINDIR. In pre-built containers / system images these are
static and known ahead of time; allow supplying them via the libpath /
default_bindir options (PYTHON_JULIACALL_LIBPATH /
PYTHON_JULIACALL_DEFAULT_BINDIR) to skip the extra process. Behaviour is
unchanged unless both are set. Docs and CHANGELOG updated.
…of libpath, exepath and bindir depending on if others are set
@cjdoris
Copy link
Copy Markdown
Member Author

cjdoris commented May 24, 2026

@ncudlenco You didn't allow permission for me to modify your PR so i've made this other branch. I reworked the logic - see the PR description above. So now you only need to set exe and lib to avoid the subprocess, you shouldn't need to set bindir at all.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 24, 2026

Benchmark Results (Julia v1)

Time benchmarks
main a8d80ee... main / a8d80ee...
basic/@py/pydict/init 0.26 ± 0.06 ms 0.261 ± 0.06 ms 0.997 ± 0.32
basic/@py/pydict/pydel 0.259 ± 0.025 ms 0.262 ± 0.03 ms 0.987 ± 0.15
basic/julia/pydict/init 0.233 ± 0.077 ms 0.233 ± 0.08 ms 1 ± 0.48
basic/julia/pydict/pydel 0.237 ± 0.037 ms 0.238 ± 0.042 ms 0.997 ± 0.23
gc/full 0.637 ± 0.004 s 0.639 ± 0.0025 s 0.996 ± 0.0074
time_to_load 2.1 ± 0.03 s 2.09 ± 0.015 s 1.01 ± 0.016
Memory benchmarks
main a8d80ee... main / a8d80ee...
basic/@py/pydict/init 5.01 k allocs: 0.0764 MB 5.01 k allocs: 0.0764 MB 1
basic/@py/pydict/pydel 5.01 k allocs: 0.0764 MB 5.01 k allocs: 0.0764 MB 1
basic/julia/pydict/init 4.01 k allocs: 0.0612 MB 4.01 k allocs: 0.0612 MB 1
basic/julia/pydict/pydel 4.01 k allocs: 0.0612 MB 4.01 k allocs: 0.0612 MB 1
gc/full 0 allocs: 0 B 0 allocs: 0 B
time_to_load 0.143 k allocs: 10.6 kB 0.143 k allocs: 10.6 kB 1

@cjdoris cjdoris merged commit 6aeeba0 into main May 24, 2026
17 of 18 checks passed
@cjdoris cjdoris deleted the 774-v2 branch May 24, 2026 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants