3 ms·
> I cannot fathom how ttfp is important. I personally do care for my concrete usage pattern. This is my use case: A long shell script that does a lot of thin
by enriquto 6y ago
> I cannot fathom how ttfp is important.
I personally do care for my concrete usage pattern.
This is my use case: A long shell script that does a lot of things. At some point, inside a loop that runs hundreds of times, it needs to solve a couple of small linear systems and plot a simple graph. There's hundreds of png graphs, that are then combined into a video sequence. Right now, the computation is done by calling octave (inside the loop) and then gnuplot (to create the actual graph from the octave computed data points). I would like to replace each call to octave+gnuplot to a single call to julia. Yet, this would make my script run in a few hours instead of a few seconds, because for this usage pattern all plots are first plots
Before you suggest that I should rewrite the whole thing in julia, maybe you are right but
1) it would take me a few weeks that I don't have
2) that's not my point. A good tool is a tool that can be used for purposes that it was not intended to, like this. If the time to first plot in julia was a millisecond instead of 10 seconds, then julia would be a much better tool.
- cbkeller 6y agoIt’s not trivial to do, but compiling plots into your sysimg might actually fix that
- enriquto 6y agoThanks! Is there a way to compile all installed packages into the sysimage? If so, why isn't that the default?
- cbkeller 6y agoTechnically yes, but then IIRC you’d have to recompile the whole sysimg any time you update any single package, which could get to be a pain. The usual compromise seems to be to include just a handful of your most used packages in the sysimg (say Plots + Revise)
- enriquto 6y ago> you’d have to recompile the whole sysimg any time you update any single package Are there any downsides to this? You never care how long does a system update take. You always care how long do your programs run.
- cbkeller 6y agoI’ve never tried it myself, but can’t think of any reason why it wouldn’t work in principle if you do want to go that route
- Sukera 6y agoThe downside is that PackageCompiler (or SnoopCompile, for that matter) can only pack into the sysimage what it sees. This is usually done by "recording" which methods get called during a session and putting the compiled native code for those into the sysimage. If it's not called during setup, you'll still have dynamic compilation (as for any code that hasn't ever run).
- DNF2 6y agoBut this is really the worst conceivable use case for Julia. Why are you interested in making this change, when Julia offers no advantage in this scenario?
- aliceryhl 6y agoIt would be a perfectly fine use-case for Julia if it wasn't so damn slow.
- enriquto 6y ago> Why are you interested in making this change, when Julia offers no advantage in this scenario? Well I love julia the language. It's the interpreter quirks that I find annoying. If julia had something lean and superfast like luajit it would be incredible!
- The_rationalist 6y agoIf only they could switch to graalvm :m
- whateverwhynot 6y agoI'm not the parent, but I faced exactly the same issue when I tried to switch to Julia from scilab. As for why I'd like to switch: Julia is a better language, it is way easy to run your script on a cluster and I've been bitten more than once by the two language problem... So Julia seems better for everything but for one of my most common use cases...
- stillyslalom 6y agoYou may want to look at [DaemonMode.jl](https://github.com/dmolina/DaemonMode.jl https://github.com/dmolina/DaemonMode.jl), which spins up a persistent Julia process in the background so you don't have to pay the TTFP penalty more than once, even when shell-scripting.
- sgt101 6y agoCould you cache the requests or write the parameters into a file and then make the call to Juila, and ask it to loop over the requests?
- stjohnswarts 6y agoI still have a soft spot for octave. It was my first matrix oriented program. I've moved on to pandas and c++ but I still pull up octave for signal analysis because it's just plain easier and has some great functions and I think it may have created folds in my brain as an EE undergrad that will always be there :)
- jarvist 6y agoAs you already have the gnuplot commands, perhaps using Julia + https://github.com/gcalderone/Gnuplot.jl https://github.com/gcalderone/Gnuplot.jl might work? It's a very lightweight package, so even using it directly should be OK. I do all my plotting with Gnuplot.jl, as gnuplot is fast, and I can save .gpt files which reproduce the plots for later reference and making publication-quality.