[rkward-tracker] [ rkward-Feature Requests-1810061 ] Speed up assignments in globalenv()

SourceForge.net noreply at sourceforge.net
Tue Oct 9 10:03:02 UTC 2007


Feature Requests item #1810061, was opened at 2007-10-09 12:03
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=459010&aid=1810061&group_id=50231

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Priority: 5
Private: No
Submitted By: Thomas Friedrichsmeier (tfry)
Assigned to: Nobody/Anonymous (nobody)
Summary: Speed up assignments in globalenv()

Initial Comment:
Assignments inside globalenv() are slow due to modification detection. Run this code:

# first create an object in a single command
x <- 1

# now assign to it many times
for (i in 1:100000) x <- 2

# in contrast, try this:
local ({for (i in 1:100000) x <- 2; x <<- x})

The latter is tremendously faster. In a plain R session, there is no such difference.

Probably we can improve on this by implementing .rk.watch.symbol(), and esp. the watch function created by .rk.make.watch.f() in C, and also fine-tuning it in the process.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=459010&aid=1810061&group_id=50231




More information about the rkward-tracker mailing list