Sharpie / RTikZDevice

A R package for producing graphics output as PGF/TikZ code for use in TeX documents.
31 stars 36 forks source link

speed up loading tikzDevice #43

Closed yihui closed 12 years ago

yihui commented 12 years ago

I have two quick suggestions for zzz.R since I see it is slightly slow to load tikzDevice:

Sharpie commented 12 years ago

Agreed. Overhauling the process used to locate TeX compliers has been on the TODO list---it is slow and doesn't scale well. Now that support for LuaTeX is on the horizon, we need something better.

Lately I just haven't had the time to work on it.

Sharpie commented 12 years ago

Just cut a 0.6.2 release to push a bugfix and clear up some issues with CRAN checks on R-devel. This release removes require(filehash) from zzz.R.

Version 0.7.0 will contain new code for locating TeX compilers.

Sharpie commented 12 years ago

I've played around with this a little bit. Here is the time it takes to load v0.6.2:

> system.time(require(tikzDevice, quietly=TRUE))

...

   user  system elapsed 
  0.220   0.033   0.262

If I completely remove all the compiler checking code, I get:

> system.time(require(tikzDevice, quietly = TRUE))

...

   user  system elapsed 
  0.200   0.007   0.209 

The compiler checks definitely need to be re-factored to be more generic and maintainable, but I don't think it is worth putting time into a speed-up that is on the order of hundredths or even tenths of a second.

yihui commented 12 years ago

0.26 sounds great. Thanks!