[Bioperl-l] SeqIO profiling

Aaron J Mackey Aaron J. Mackey" <amackey@virginia.edu
Tue, 17 Sep 2002 07:35:23 -0400 (EDT)


On Mon, 16 Sep 2002, Hilmar Lapp wrote:

> What surprises me is the high number of BEGIN calls. Me being
> surprised reflects my unwillingness to read perl-guts docs. I
> thought the BEGIN block is only executed when the module is
> _loaded_, which supposedly happens only once during execution.

It happens on every new object creation; think of it as a
non-thread-related CLONE method; in an OO context, it's the only
"constructor" guaranteed to be called before all else.

> Aaron, if you replaced BEGIN by INIT in Root.pm and RootI.pm, would
> that save any significant time?

It saved about 10%; I then got lots of warnings during make test about
"too late to call INIT now", but I didn't track them down.

So a BEGIN -> INIT sweep might be in order (or some consideration of why
the BEGIN blocks are even there; some just seem to be setting static
global variables, why must that be done in a BEGIN?)

I'm also looking into a compiled _rearrange method ...

-Aaron

-- 
 Aaron J Mackey
 Pearson Laboratory
 University of Virginia
 (434) 924-2821
 amackey@virginia.edu