[Bioperl-l] SeqIO profiling

Aaron J Mackey Aaron J. Mackey" <amackey@virginia.edu
Thu, 19 Sep 2002 13:53:13 -0400 (EDT)


On Thu, 19 Sep 2002, Steve Chervitz wrote:

> I'm still perplexed about all of the repeated BEGIN calls that Aaron found (see
> below). From what I have read and tested, BEGIN should be called once during
> compilation time.

Right.

> Maybe there was something about the profiling environment that lead to all of
> the BEGIN calls that Aaron found. Aaron, can you run your profiler on the above
> simple script and see if you get multiple BEGIN hits?

I was thinking we may have found a big bug in Perl, but in fact I think
it's just a bug in dprofpp (or Devel::DProf, not sure).  While perl only
executes the BEGIN block once, the "stub" for it remains in the op-tree
as a no-op (and is thus reported in the call trace); to answer Heikki's
earlier question about should we remove all BEGIN blocks, my profiling
numbers seem to suggest that you do get a small win; that BEGIN no-op does
take a couple of ticks of the op-tree walking code ...

At least that's my somewhat-uninformed interpretation of what's going on
under the sheets.

-Aaron