[R] tcl/tk printing to console is far too slow

Alex Couture-Beil alex at mofo.ca
Sat Mar 3 23:22:27 CET 2007


Hello - I am finding that printing to the console from a function that 
is invoked from tcl/tk (i.e. pushing a button) is really slow.
Consider the following example.

doStuff <- function() {
    source(file.path(system.file(package = "base"), "demo", 
"is.things.R"), echo=TRUE)
}

tt <- tktoplevel()
button.widget <- tkbutton(tt,text="Do Stuff", command=doStuff)
tkpack(button.widget)


I find that this is significantly slower than if I ran source(...) 
directly from the console prompt. In the back of my mind, I am thinking 
this might be some effect related to multi-threading and the 
locking/unlocking of a mutex - am I right?

Any help to speed this up would be appreciated.

Thanks,
Alex Couture-Beil

PS: I am running this test with R 2.4.1 on WinXP



More information about the R-help mailing list