Precompilation significantly slows Julia startup
- Lenguaje dominante
- Julia
- Estrellas
- 1.5k
- Forks
- 186
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
Julia startup time with PyCall precompiled into base/userimg.jl jumps in commit d19995c5fd895aa6a249cb6b6d1164dc2826e8f2 from <1 second to ~10 seconds on several of my machines (with both Julia 0.3.6 and some 0.4 masters).
I found this with a git bisect using a quick and dirty script:
``` bash
#!/bin/bash
# GOOD PyCall: 896f82a
# BAD PyCall: ebe352f
JIFILE=/tmp/test_bisect
julia /home/jason/src/julia/contrib/build_sysimg.jl $JIFILE native /tmp/userimg.jl --force > /dev/null
T1=`date +%s`
/bin/time -f %U julia -J ${JIFILE}.ji -E "0"
TIME=$(echo `date +%s`-$T1 | bc -l)
echo $TIME
if [[ `echo "$TIME>2" | bc -l` -eq 1 ]]; then
echo "Long"
exit 1
else
echo "Short"
exit 0
fi
```
I'm not actually sure if this is a problem with PyCall or Julia, so if the latter, then let me know and I'll move the bug up the stack.
I don't know enough about PyCall to debug this further, but I did do some macro level debugging in [this mailing list thread](https://groups.google.com/forum/#!topic/julia-dev/uvEgky_QKmY). At the time I did not know that it was from PyCall specifically.
Oh, and another gotcha: the slow start seems to be dependent on stdout. Let me show you what I mean:
``` julia
$ /bin/time -f %U julia -J /tmp/test_newgit.ji -E 0 # slow start
0
9.03
$ julia -J /tmp/test_newgit.ji -E 0 >/dev/null # fast start
0.63
$ julia -J /tmp/test_newgit.ji -e 0 # fast start
0.59
$ julia -J /tmp/test_newgit.ji -e "println(3)" # slow start
3
9.40
```
Whereas with a commit before d19995c5fd895aa6a249cb6b6d1164dc2826e8f2 (precompiled), all of these would be fast.
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Start with the reported regression commits d19995c5fd895aa6a249cb6b6d1164dc2826e8f2, 896f82a, and ebe352f, then inspect contrib/build_sysimg.jl and reproduce the timing with the supplied bash script. Compare startup with stdout redirected and with different expressions, and use the linked mailing-list investigation to isolate whether PyCall or Julia causes the slowdown. Done means identifying the regression and restoring fast precompiled startup.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- bash, julia, python
- Área
- performance
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 32/100