Suraj
Suraj

Reputation: 36587

R 2.14 byte compile - why not?

Why wouldn't I byte-compile all the packages I install? Is there some consequence of byte-compile making it a decision to think about?

Upvotes: 6

Views: 304

Answers (3)

Tomas Kalibera
Tomas Kalibera

Reputation: 1061

Currently the development version of R already byte-compiles all packages by default, so one does not have to turn byte-compilation on in the DESCRIPTION file. A related answer mentions overheads of byte-compilation - it is possible but rare that byte-compilation would harm performance (it can happen when code is loaded that will never be used - the JIT won't compile it, but the loader still loads it; hopefully this can be addressed in the future).

browser() and debugging with the byte-compiled code works, from the user perspective, the same way as with non-compiled code. Internally the debugger runs on the AST of the program (so bypassing the byte-code), but this is not visible to the user.

Upvotes: 1

csgillespie
csgillespie

Reputation: 60492

In R version 2.14, a major downside of byte-compiling was that it could slow down certain functions. Another two downsides were increased package size and installation.

For the current version of R (3.3.X), I have yet to find a downside for byte-compiling.

Upvotes: 1

geoffjentry
geoffjentry

Reputation: 4754

One negative is that you can't debug byte compiled code. On the flip side, once the code is production ready, in theory you wouldn't need that (and you could reinstall it w/o byte compilation if you needed to)

Upvotes: 3

Related Questions