[cgiapp] Re: Class::MOP and performance

2006-07-02 Thread Mark Stosberg

Ricardo SIGNES wrote:

Did anyone (Mark?) look at the performance hit that Class::MOP will cause?
I've only taken a quick look, but it looks like the total user time to run test
suite goes up nearly 50% with this patch.


I hadn't done that, but it's certainly worth doing.  I did just a few 
tests now, and found something on the order of a 10 to 25% increase.



I'm assuming that a more hook-laden class will suffer even more.  Benchmarks?


Not necessarily. It depends on whether the time is mostly in the 
module-load time, or the method call time. Looking at the code, I see 
some caching in the actual method call, so I suspect the module load time.


Still, the performance hit is enough for me to want to revert the patch.
It was interesting to learn about how this will work in Perl6, but 
considering this drawback, I can wait for the Perl6 port to actually 
apply the knowledge!


Thanks for your attentive to this.

I'll report our results back to the Class::MOP author.

  Mark



-
Web Archive:  http://www.mail-archive.com/cgiapp@lists.erlbaum.net/
 http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [cgiapp] Re: Class::MOP and performance

2006-07-02 Thread Rob Kinyon

There are ways to improve the caching used in Class::MOP - I can see if
$work will allow Stevan (author of Class::MOP and Moose) and I to work on
some details.

One thing I know that he and nothingmuch have been working on in Moose is
the ability to declare a class "closed" which will allow for Moose to cache
all the lookups at compiletime. I'm pretty sure there isn't something
similar for Class::MOP right now, but there may be able to be something
added that will allow that.

Of course, this is a major hit for compiletime which affects the testsuite's
running time quite dramatically. It will also be a pretty big runtime hit
for pure CGI scripts using CGI::Application. Using this under some
persistent environment (modperl or FCGI) will obviously negate that hit.

Rob

On 7/2/06, Mark Stosberg <[EMAIL PROTECTED]> wrote:


Ricardo SIGNES wrote:
> Did anyone (Mark?) look at the performance hit that Class::MOP will
cause?
> I've only taken a quick look, but it looks like the total user time to
run test
> suite goes up nearly 50% with this patch.

I hadn't done that, but it's certainly worth doing.  I did just a few
tests now, and found something on the order of a 10 to 25% increase.

> I'm assuming that a more hook-laden class will suffer even
more.  Benchmarks?

Not necessarily. It depends on whether the time is mostly in the
module-load time, or the method call time. Looking at the code, I see
some caching in the actual method call, so I suspect the module load time.

Still, the performance hit is enough for me to want to revert the patch.
It was interesting to learn about how this will work in Perl6, but
considering this drawback, I can wait for the Perl6 port to actually
apply the knowledge!

Thanks for your attentive to this.

I'll report our results back to the Class::MOP author.



There are ways to improve the caching used in Class::MOP - I can see if
$work will allow Stevan (author of Class::MOP and Moose) and I to work on
some details.

One thing I know that he and nothingmuch have been working on in Moose is
the ability to declare a class "closed" which will allow for Moose to cache
all the lookups at compiletime. I'm pretty sure there isn't something
similar for Class::MOP right now, but there may be able to be something
added that will allow that.

Of course, this is a major hit for compiletime which affects the testsuite's
running time quite dramatically. It will also be a pretty big runtime hit
for pure CGI scripts using CGI::Application. Using this under some
persistent environment (modperl or FCGI) will obviously negate that hit.

Rob


Re: [cgiapp] Re: Class::MOP and performance

2006-07-03 Thread Ricardo SIGNES
* Rob Kinyon <[EMAIL PROTECTED]> [2006-07-02T23:00:18]
> One thing I know that he and nothingmuch have been working on in Moose is
> the ability to declare a class "closed" which will allow for Moose to cache

...yeah, I was wondering if that closed-ness feature was a MOP-ism or a
Moosism.

> Of course, this is a major hit for compiletime which affects the testsuite's
> running time quite dramatically. It will also be a pretty big runtime hit
> for pure CGI scripts using CGI::Application. Using this under some
> persistent environment (modperl or FCGI) will obviously negate that hit.

This is another good reason to work on making CGI::Application easier to use
under mod_perl!

-- 
rjbs


signature.asc
Description: Digital signature


Re: [cgiapp] Re: Class::MOP and performance

2006-07-03 Thread Timothy Appnel

BTW: Perl.com editor chromatic wrote up a review of Class::MOP for
those who aren't familiar with that package like I was.

http://www.oreillynet.com/onlamp/blog/2006/06/cpan_module_review_classmop.html



-
Web Archive:  http://www.mail-archive.com/cgiapp@lists.erlbaum.net/
 http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [cgiapp] Re: Class::MOP and performance

2006-07-05 Thread Perrin Harkins
On Mon, 2006-07-03 at 08:40 -0400, Ricardo SIGNES wrote:
> This is another good reason to work on making CGI::Application easier to use
> under mod_perl!

Is there something difficult about using it under mod_perl?

- Perrin


-
Web Archive:  http://www.mail-archive.com/cgiapp@lists.erlbaum.net/
  http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [cgiapp] Re: Class::MOP and performance

2006-07-05 Thread Cees Hek

On 7/5/06, Perrin Harkins <[EMAIL PROTECTED]> wrote:

On Mon, 2006-07-03 at 08:40 -0400, Ricardo SIGNES wrote:
> This is another good reason to work on making CGI::Application easier to use
> under mod_perl!

Is there something difficult about using it under mod_perl?


I think he is considering calling 'new' on a CGI::App object once, and
then calling 'run' on it multiple times in a mod_perl environment.
Currently that can lead to problems with leftover info in the object.

However, the cost of creating a new CGI::App object is very minimal,
so I don't think it is really a big problem at the moment.

Cheers,

Cees

-
Web Archive:  http://www.mail-archive.com/cgiapp@lists.erlbaum.net/
 http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [cgiapp] Re: Class::MOP and performance

2006-07-12 Thread Rob Kinyon

On 7/5/06, Cees Hek <[EMAIL PROTECTED]> wrote:

On 7/5/06, Perrin Harkins <[EMAIL PROTECTED]> wrote:
> On Mon, 2006-07-03 at 08:40 -0400, Ricardo SIGNES wrote:
> > This is another good reason to work on making CGI::Application easier to use
> > under mod_perl!
>
> Is there something difficult about using it under mod_perl?

I think he is considering calling 'new' on a CGI::App object once, and
then calling 'run' on it multiple times in a mod_perl environment.
Currently that can lead to problems with leftover info in the object.

However, the cost of creating a new CGI::App object is very minimal,
so I don't think it is really a big problem at the moment.


That's not the problem. The cost isn't in creating the object, it's in
running setup() every time (which is what C::A::P::Apache ends up
doing).

Rob

-
Web Archive:  http://www.mail-archive.com/cgiapp@lists.erlbaum.net/
 http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]