Re: [Rd] cache most-recent dispatch

2013-07-02 Thread Hervé Pagès
Hi Val, [off list... I don't want to compromise your chances to start a constructive discussion ;-)] Thanks for reporting this. Just wanted to mention that the reason I think the situation is worst when you use the paste() generic defined in BiocGenerics than when you make paste() a generic

Re: [Rd] cache most-recent dispatch

2013-07-02 Thread John Chambers
It's hard to see how repeated dispatch on the same classes can be that slow, _if_ the function being called each time is itself doing some substantial work. The first call (in a session) with a particular signature searches for inherited methods and stores the method found in a table. The

Re: [Rd] cache most-recent dispatch

2013-07-02 Thread Valerie Obenchain
Thanks for the background and suggestions. Valerie On 07/02/2013 08:41 AM, John Chambers wrote: It's hard to see how repeated dispatch on the same classes can be that slow, _if_ the function being called each time is itself doing some substantial work. The first call (in a session) with a

[Rd] cache most-recent dispatch

2013-07-01 Thread Valerie Obenchain
Hi, S4 method dispatch can be very slow. Would it be reasonable to cache the most recent dispatch, anticipating the next invocation will be on the same type? This would be very helpful in loops. fun0 - function(x) sapply(x, paste, collapse=+) fun1 - function(x) { paste -