Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

To Genie users, what is your workflow ? I love Julia for scientific computing but the compilation time is a bit of an issue. I would imagine I would need to compile a lot more when doing web dev. How do you work around this ?

If there is a solution to this, Genie would be awesome as I could directly put into production my Julia models without using a third party language.



Revise.jl[1] is very helpful for development, as it allows for seamless recompilation without restarts. Cold start can also take a long time, so sometimes it helps to add options[2] such as -O0 when developing. Two paths forward for AOT compilation are PackageCompiler.jl[3] mentioned already in this thread (things like RelocatableFolders.jl[4] come in handy) and the possibility of GPUCompiler.jl[5] some day.

[1]: https://github.com/timholy/Revise.jl

[2]: https://docs.julialang.org/en/v1/manual/command-line-options...

[3]: https://github.com/JuliaLang/PackageCompiler.jl

[4]: https://github.com/JuliaPackaging/RelocatableFolders.jl

[5]: https://github.com/JuliaGPU/GPUCompiler.jl/issues/3


I haven’t used Genie (though after this post I am tempted!) but I imagine compilation overhead would only occur once (e.g. the first time each route is used) and that you could pretty easily use precompile statements and/or PackageCompiler.jl to do the compilation before the service goes live. After that point, Julia should have produced fast code and provides a good runtime for these kinds of async/multithreaded applications with built-in M:N scheduling (perhaps a concurrent/multithreaded GC might help reduce tail latency but I imagine it should already be competitive with everything but well-written Rust/C++/C).


I only use Genie slightly to add a simple UI to my projects - I'm no web dev. Time to first request is as terrible as you would expect, but one can then dynamically iterate on a running interpreter by changing and adding pieces, and then it's not that bad as only the new bits need recompilation.

I never tried the fancy to speed up compilation.


Have you tried PackageCompiler.jl?


Honestly, this is an area where the op would be far better served by using go/rust/c++ or another backend language. Can launch a server with microsecond latency, and if it grows get good elastic behavior. No awkward route precompilation or thirty minute build times... Julia sure is neat, but this isn't an area where it's strong.


I do webdev in Go, and freely recompile as it takes a second or less on my hardware which consists of a rock, a rubber band and two sesame seeds on 20x2 liquid crystal. Its no struggle to recompile 100x in a day just iterating.


microsecond latency? on what exact hardware are you seeing that?


That was a somewhat hyperbolic statement. Make an application in node, genie, and rusts actix. Run them and see how fast it takes for the cli to load each of them. Feel free to package compiler the Julia one if you want. It's a good experiment with visual results.


Must be new M1 Ultra or something.


P50 for basic routes using other web frameworks can be sub 0.5 ms. See the techempower benchmarks. These benchmarks are somewhat flawed, but I'd be surprised if genie was faster then flask all around, and flask is widely considered expensively slow.


0.5 ms is 500 times longer than the comment above, though




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: