Re: [Bioc-devel] S4 Method Slow Execution if Signature Has Multiple Class Unions

2021-12-03 Thread Michael Lawrence via Bioc-devel
Hi Dario, Thanks for the reproducible example. The time comes from building all the possible signatures when dispatching the first time. The expense comes from the length of the signature. After the first dispatch, the table is cached and everything is fast. Have you considered just using an ord

Re: [Bioc-devel] S4 Method Slow Execution if Signature Has Multiple Class Unions

2021-11-24 Thread Dario Strbenac via Bioc-devel
Hello, Thanks. It was difficult to pinpoint, but I was able to make a minimal example. It happens only if SummarizedExperiment is pre-loaded. The difference is 0.2 seconds versus 32 seconds on my modest Windows 10 laptop computer - a 150 times slowdown. Can you reproduce it? library(Summarized

Re: [Bioc-devel] S4 Method Slow Execution if Signature Has Multiple Class Unions

2021-11-23 Thread Michael Lawrence via Bioc-devel
Hi Dario, Thanks for bringing this up. The second time speed could be explained by the caching that happens inside the methods package. If you are able to come up with a smaller reproducible example, I would be happy to help out. Michael On Mon, Nov 22, 2021 at 1:00 PM Dario Strbenac via Bioc-de

[Bioc-devel] S4 Method Slow Execution if Signature Has Multiple Class Unions

2021-11-22 Thread Dario Strbenac via Bioc-devel
Good day, I created two constructor methods for a generic function. One is for the default empty constructor and the other is a constructor when any one or more parameters is specified by the user. The method signatures are: 1. c("missing", "missing", "missing", "missing", "missing", "missing",