[Bioperl-l] SeqIO profiling

Tim Bunce Tim.Bunce@pobox.com
Thu, 19 Sep 2002 23:11:47 +0100


On Wed, Sep 18, 2002 at 11:49:21PM +0100, Matthew Pocock wrote:
> Hilmar Lapp wrote:
> >On Tuesday, September 17, 2002, at 07:24 AM, Tim Bunce wrote:
> >
> >>The "too late to call INIT now" warning is hinting at what is
> >>probably the real problem: some code is being loaded at run time.
> >>Find that code.
> >
> >Thanks for the tip. Yes, we do load code at runtime.

Why? Where? (in relation to SeqIO profiling)

> >Since all modules 
> >inherit from Bio::Root::Root, INIT is not an option then.
> >
> >I do agree with Aaron. Most if not all of the things I've seen in BEGIN 
> >blocks are initialization of static variables.
> 
> Can you not just put this code directly in the package, or in an 
> anonymous block (if you need to scope variables)?
> 
> As for walking the ISA tree, I believe once a package has located a 
> method via ISA, it caches this reference in some magic space in the 
> package. Then, next time it will fetch the sub ref from this magic 
> rather than by walking ISA. If @ISA is modified, then the cache gets 
> flushed (or the lookup step flushes the cache or something). Of course, 
> I may be wrong on this - I don't use perl daily.

You're right. (The lookup flushes caches if they're older than the last
@ISA change - measured in terms of a generation number.)

Tim.