Displaying 1 result from an estimated 1 matches for "jjsa4".
Did you mean:
jjsa
2004 Mar 27
1
Re: [S] scalability
...t;)
sumS3.default <- function(x, ...) sum(x, ...)
gc()
system.time(jjsa3 <- apply(jja, 1:2, sumS3)) # takes 65 seconds
sumS4 <- function(x, ...) standardGeneric("sumS4")
setMethod("sumS4", signature(x="numeric"), function(x, ...) sum(x, ...))
gc()
system.time(jjsa4 <- apply(jja, 1:2, sumS4)) # takes 58 seconds
Questions:
It looks to me like the penalty for making the functions generic is
similar to one extra function call. Does the penalty grow as there
are more methods? Are there other types of penalties for making
a function generic?
Is the test wit...