3 ms·
"The JIT (‘Just In Time’) byte-code compiler is now enabled by default at its level 3. This means functions will be compiled on first or second use and top-leve
by mobileexpert 9y ago
"The JIT (‘Just In Time’) byte-code compiler is now enabled by default at its level 3. This means functions will be compiled on first or second use and top-level loops will be compiled and then run. (Thanks to Tomas Kalibera for extensive work to make this possible.)"
Very exciting.
- jordigh 9y agoOh, man, I wonder how they did it. We have a toy JIT compiler in Octave that bitrotted to death and we haven't managed to attract anyone else to pick up that project.
- plg 9y agoDoes this mean simple for-loops in R will be faster? Currently R can be order(s) of magnitude slower than MATLAB / Python. Does one have to do something specific to use the JIT or is it automagic?
- jmount 9y agoSpeed differences of that magnitude are largely due to bad interactions with R's data allocation model. R for loops are not that slow if there is no allocation going on, and there are ways to organize the allocation ahead of time: http://www.win-vector.com/blog/2015/07/efficient-accumulation-in-r/ http://www.win-vector.com/blog/2015/07/efficient-accumulatio... So my guess is: no the JIT won't help for ultra slow code as in my experience that isn't the problem in that case.
- yread 9y agoReally nice article, shows why writing fast R code is such a pain. I had no idea that data frame is that much worse than data table.
- haddr 9y agoWhile this is a great article, it also transmits some truth about R: writing anything fast is a pain in the ass. Especially frustrating when you hear those R "experts" repeating "use apply" functions. The truth is, the design of the language requires you to actually learn some dirty details and NOT solely rely on the idiomatic syntax. I like R quite much, but this is a sign of a bad language design.
- stewbrew 9y agoIt was possble to enable the JIT before. They are light on details how the JIT was changed so that they enabled it by default.
- iaw 9y agoWow, I skimmed but I didn't catch the significance of this. That's amazing.
- klmr 9y agoI think the reason this wasn’t enabled until now is that the JIT didn’t universally make code faster. There were some specific cases where it in fact made code slower. I’d love to know whether/how this was solved.