You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Raf <ra...@joshua.dreamthought.com> on 2007/01/23 18:40:26 UTC

DateTime with Apache::SmallProf

Apologies for the X-post.  It seemed appropriate.

I'm trying to profile a web environment (Apache 1.3.33/Perl 5.8.7/mp 1.29)
with Apache::SmallProf, however I seem to be getting some odd behaviour
from DateTime when smallprof is enabled.

We have a module using DateTime.pm, which is used in a CGI script, eval'ed
by Apache::Registry.  It appears that DateTime throws a locale error on
the 'use DateTime' which gets propogated back through our module and onto
Registry.  However this 'only' occurs when Apache::DB and
Apache::Smallprof are enabled.

I've snooped in DateTime and am not sure how SmallProf is causing this
error, so I'm hoping that someone else may be familiar with the
symptoms?

The error:

[Tue Jan 23 17:57:26 2007] bvsm.pm: [Tue Jan 23 17:57:26 2007] bvsm.pm:
You cannot replace an existing locale ('') unless you also specify the
'replace' parameter as true
[Tue Jan 23 17:57:26 2007] bvsm.pm: [Tue Jan 23 17:57:26 2007] bvsm.pm:
BEGIN failed--compilation aborted at
/usr/lib/perl5/vendor_perl/5.8.7/DateTime/Locale.pm line 162.
[Tue Jan 23 17:57:26 2007] bvsm.pm: [Tue Jan 23 17:57:26 2007] bvsm.pm:
Compilation failed in require at
/usr/lib/perl5/vendor_perl/5.8.7/i686-linux/DateTime.pm line 47.
[Tue Jan 23 17:57:26 2007] bvsm.pm: [Tue Jan 23 17:57:26 2007] bvsm.pm:
BEGIN failed--compilation aborted at
/usr/lib/perl5/vendor_perl/5.8.7/i686-linux/DateTime.pm line 47.
[Tue Jan 23 17:57:26 2007] bvsm.pm: [Tue Jan 23 17:57:26 2007] bvsm.pm:
Compilation failed in require at /etc/perl/bvsm.pm line 16.
[Tue Jan 23 17:57:26 2007] bvsm.pm: [Tue Jan 23 17:57:26 2007] bvsm.pm:
BEGIN failed--compilation aborted at /etc/perl/bvsm.pm line 16.
[Tue Jan 23 17:57:26 2007] bvsm.pm: Compilation failed in require at (eval
195)[/usr/lib/perl5/vendor_perl/5.8.5/i686-linux/Apache/Registry.pm:183]
line 4.
BEGIN failed--compilation aborted at (eval
195)[/usr/lib/perl5/vendor_perl/5.8.5/i686-linux/Apache/Registry.pm:183]
line 4.



Any suggestions would be appreicated.

Thanks,

Raf


Re: DateTime with Apache::SmallProf

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
Raf wrote:
> On Wed, 24 Jan 2007, Perrin Harkins wrote:
> 
>>On 1/24/07, Raf <ra...@joshua.dreamthought.com> wrote:
>>
>>>The code base I'm profiling is very big, monolithic and convoluted.  I
>>>felt that level of granularity given by smallprof would probably give me
>>>more coverage - which I believe I need.
>>
>>Usually that's the reason you use DProf -- it gives you the big
>>picture.  SmallProf is only useful when you've got it down to one sub
>>and you can't figure out which lines in the sub are taking the time.
> 
> 
> Since you put it like that, I stand corrected and don't know what I had
> been thinking. :)  DProf does not seem to be causing DateTime to die, and
> I suppose that while resolving my problem, it still leaves the original
> question open as an X-File.

I'm not a big profiling expert, but I've heard rumors around work that
we could never get Apache::DProf to really work (due to some magic in
own own code), but that the apache hooks in Devel::Profiler worked much
better.  ymmv.

--Geoff

Re: DateTime with Apache::SmallProf

Posted by Raf <ra...@joshua.dreamthought.com>.
On Wed, 24 Jan 2007, Perrin Harkins wrote:
> On 1/24/07, Raf <ra...@joshua.dreamthought.com> wrote:
> > The code base I'm profiling is very big, monolithic and convoluted.  I
> > felt that level of granularity given by smallprof would probably give me
> > more coverage - which I believe I need.
>
> Usually that's the reason you use DProf -- it gives you the big
> picture.  SmallProf is only useful when you've got it down to one sub
> and you can't figure out which lines in the sub are taking the time.

Since you put it like that, I stand corrected and don't know what I had
been thinking. :)  DProf does not seem to be causing DateTime to die, and
I suppose that while resolving my problem, it still leaves the original
question open as an X-File.

Thanks,

Raf


Re: DateTime with Apache::SmallProf

Posted by Perrin Harkins <ph...@gmail.com>.
On 1/24/07, Raf <ra...@joshua.dreamthought.com> wrote:
> The code base I'm profiling is very big, monolithic and convoluted.  I
> felt that level of granularity given by smallprof would probably give me
> more coverage - which I believe I need.

Usually that's the reason you use DProf -- it gives you the big
picture.  SmallProf is only useful when you've got it down to one sub
and you can't figure out which lines in the sub are taking the time.

> In any case, I can't see why it causes DateTime to carp?

No idea about that.  Sounds like a classic case of too much magic in
one module or the other.  You'd have to dig in and run it through the
debugger if you really want to solve that.

- Perrin

Re: DateTime with Apache::SmallProf

Posted by Raf <ra...@joshua.dreamthought.com>.
Hi Philip,

On Tue, 23 Jan 2007, Philip M. Gollucci wrote:
> Raf wrote:
> > Apologies for the X-post.  It seemed appropriate.
> >
> Mot off the top of my head, why are you using Apache::SmallProf and not
> Apache::Dprof -- the previous is usually too low level.

The code base I'm profiling is very big, monolithic and convoluted.  I
felt that level of granularity given by smallprof would probably give me
more coverage - which I believe I need.

In any case, I can't see why it causes DateTime to carp?

Thoughts still welcome?

Thanks,

Raf


Re: DateTime with Apache::SmallProf

Posted by "Philip M. Gollucci" <pg...@p6m7g8.com>.
Raf wrote:
> Apologies for the X-post.  It seemed appropriate.
> 
> I'm trying to profile a web environment (Apache 1.3.33/Perl 5.8.7/mp 1.29)
> with Apache::SmallProf, however I seem to be getting some odd behaviour
> from DateTime when smallprof is enabled.
> 
> We have a module using DateTime.pm, which is used in a CGI script, eval'ed
> by Apache::Registry.  It appears that DateTime throws a locale error on
> the 'use DateTime' which gets propogated back through our module and onto
> Registry.  However this 'only' occurs when Apache::DB and
> Apache::Smallprof are enabled.
> 
> I've snooped in DateTime and am not sure how SmallProf is causing this
> error, so I'm hoping that someone else may be familiar with the
> symptoms?
Mot off the top of my head, why are you using Apache::SmallProf and not
Apache::Dprof -- the previous is usually too low level.

-- 
------------------------------------------------------------------------
Philip M. Gollucci (pgollucci@p6m7g8.com) 323.219.4708
Consultant - P6M7G8 Consutling - http://p6m7g8.net/Resume/resume.shtml
Senior Software Engineer - Ticketmaster - http://ticketmaster.com
1024D/EC88A0BF 0DE5 C55C 6BF3 B235 2DAB  B89E 1324 9B4F EC88 A0BF

We're halfway there
Livin' on a prayer
Take my hand and we'll make it-I swear
Livin' on a prayer