Displaying 1 result from an estimated 1 matches for "list_u3".
Did you mean:
list_u
2012 Jul 12
1
Modifying a list: what gets copied?
...deep copy, but
the overhead for modifying a list is considerably higher than
modifying a list (roughly equivalent to copying a integer vector of
50,000 elements)
To make sure it wasn't just the way I was modifying the list, I tried
a few alternatives:
list_u2 <- function(x) z[[2]] <- 1L
list_u3 <- function(x) z[["a"]] <- 1L
list_u4 <- function(x) z[1] <- list(1L)
microbenchmark(
list_u(zs$e4),
list_u2(zs$e4),
list_u3(zs$e4),
list_u4(zs$e4)
)
Unit: microseconds
expr min lq median uq max
1 list_u(zs$e4) 125 430 447 471 677
2 list_u2(zs$e...