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
From:
Dave Mitchell
Date:
June 30, 2009 06:54
Subject:
Re: [perl #42329] Carp::croak() replace user error message by own
Message ID:
20090630135444.GD10432@iabyn.com
On Mon, Jun 29, 2009 at 12:29:54PM +0200, Rafael Garcia-Suarez wrote:
> 2009/6/29 Alex Efros <powerman@powerman.name>:
> > Only I can do is try to explain again: error-reporting code like Carp MUST NOT
> > request additional resources - because if some error happens it's very
> > likely 'not enough resources' error and trying to get more resources just
> > to show error message just feels wrong.
> >
> > I think correct solution will be to load Carp::Heavy together with Carp.
> > I see no reason to delay loading Carp::Heavy - it's very small and
> > 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.

Just as a data point, Carp::Heavy seems to use about 250Kbyte, which is,
erm, quite heavy:

(linux, 4K pagesize, 32-bit, blead, threaded, -O2):


$ p -e 'system"ps -lfp $$"'
F S UID        PID  PPID  C PRI  NI ADDR SZ WCHAN  STIME TTY          TIME CMD
0 S davem     9798  3295  0  80   0 -  1474 wait   14:50 pts/1    00:00:00 ./per
$ p -MCarp -e 'system"ps -lfp $$"'
F S UID        PID  PPID  C PRI  NI ADDR SZ WCHAN  STIME TTY          TIME CMD
0 S davem     9804  3295  0  80   0 -  1474 wait   14:50 pts/1    00:00:00 ./per
$ p -MCarp::Heavy -e 'system"ps -lfp $$"'
F S UID        PID  PPID  C PRI  NI ADDR SZ WCHAN  STIME TTY          TIME CMD
0 S davem     9814  3295  0  80   0 -  1540 wait   14:50 pts/1    00:00:00 ./per


-- 
Art is anything that has a label (especially if the label is "untitled 1")

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About