If you are on Julia 0.2, the biggest improvement will come from moving to
Julia 0.3-pre (nightly builds) where pre-compilation functionality was
added. This should get startup time down to around 0.5s or so depending on
your computer. You would still need some JIT time for your own code, but
this should be much less than 9s. It is also possible (still potentially a
bit buggy, therefore undocumented) to include custom code in this system
image. To do this you will need to compile Julia yourself, and create a
file called `base/userimg.jl` containing your code, or `include` statements
to pull in your script. (Search the list for "userimg.jl" for more
information).

For distributed computation you may also want to investigate Julia's
parallelism functionality (allows to start remote worker nodes and
distribute batch computations to them, thereby only requiring a one-time
startup delay).


On Sat, May 17, 2014 at 1:15 AM, Vale Cofer-Shabica <
vale.cofershab...@gmail.com> wrote:

> My apologies if I've missed something fundamental; I'm half a day into
> using Julia. I'm porting a classical mechanics simulation from C to Julia.
> Even in the C case, my potential energy function is FORTRAN "black box".
> I've written a wrapper and am able to call the function easily. This is
> great! I can run my code from the cli, but it's very slow:
>
> % time LD_LIBRARY_PATH=. julia testPotential-julia.jl
> ...
> LD_LIBRARY_PATH=. julia testPotential-julia.jl  9.01s user 0.10s system
> 98% cpu 9.233 total
>
> if I do the same thing in the REPL, it's very fast (after the initial
> compilation):
>  LD_LIBRARY_PATH=. julia -L testPotential-julia.jl
> ...
> julia> @time main()
> ...
> elapsed time: 0.001423427 seconds (12048 bytes allocated)
>
> How do I combine the two? I'd like to be able to be able to repeatably
> execute a binary from the command line---it's fine even if it's julia with
> arguments---and have the kind of speed I get when I repeatedly execute from
> within the REPL.Is this possible? If not, does anyone have a sane way to
> use Julia code on distributed batch queuing systems?
>
> Many thanks,
> vale
>
>

Reply via email to