develooper Front page | perl.perl5.porters | Postings from June 2009

Re: [perl #42329] Carp::croak() replace user error message by own

Thread Previous | Thread Next
Nicholas Clark
June 29, 2009 05:46
Re: [perl #42329] Carp::croak() replace user error message by own
Message ID:
On Mon, Jun 29, 2009 at 08:31:06AM -0400, Jim Cromie wrote:
> >> shouldn't affect performance. Moreover, if you wanna speedup Carp loading,
> >> then there a lot of other techniques - like moving POD to the bottom of
> >> file under __END__. Also consider just moving Carp::Heavy content to Carp,
> >> this shouldn't increase Carp module load time by any noticeable value and
> >> also allow to do some code cleanup.
> >
> > I tend to concur. Those days we have more CPU and memory resources, so
> > a cleanup to merge Carp::Heavy in Carp is totally feasible.
> >
> By extension, this also applies to Config ?

Rafael may well disagree with me, but I don't think it should apply to Config.

My reasoning for splitting apart was that a monolithic
loads (at least) 32K of data that is rarely used, and cloned to each and every
thread, if you're using threads. I've not measured Carp::Heavy, but I suspect
that it's less than 32K, and as it's mostly ops, there's not going to be
anywhere near as much thread overhead.

Config doesn't fail catastrophically if it fails to load,
whereas as Alex Efros notes, Carp failing will eat the error message.

Additionally, the code needed to split Carp::Heavy out from Carp looks
complex, and I suspect is fragile, whereas the AUTOLOAD subroutine in is in one place, simple and conventional. (As conventional as
anything using AutoLoader)

Nicholas Clark

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About