简体   繁体   中英

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?

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)

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM