Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
performance issues
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Seth Daniel  
View profile  
 More options Sep 17 2008, 8:57 pm
From: Seth Daniel <proto...@sethdaniel.org>
Date: Wed, 17 Sep 2008 17:57:50 -0700
Local: Wed, Sep 17 2008 8:57 pm
Subject: performance issues
Hello,

Where I work [1] we are thinking about using Protocol Buffers.  However we
have found that the current perl implementation has some performance
issues.  There has been at least one message to this list that touches
on this:

http://groups.google.com/group/protobuf-perl/browse_thread/thread/364...

We are seeing the same issues.  Even for smaller messages (12k-20k) we
are seeing 5-10 seconds for deserialization.  For messages with embedded
messages the serialization also becomes very slow.

So I ask: is there currently a plan or idea of how these performance
issues can be resolved?  If so, what is it?

We are willing to help and at least one of our developers has already
submitted a number of patches to this project.  Before we commit
significant time to this we'd like to know what thought or effort has
already gone into resolving these issues.

[1] I am writing from my personal e-mail address, not my work e-mail
address, fyi.  I work for a company named Oversee.net.  

--
seth /\ sethdaniel.org


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brad Fitzpatrick  
View profile  
 More options Sep 25 2008, 6:33 am
From: "Brad Fitzpatrick" <b...@danga.com>
Date: Thu, 25 Sep 2008 14:33:33 +0400
Local: Thurs, Sep 25 2008 6:33 am
Subject: Re: performance issues

Yeah, it appears that Moose is slow.  :-/
Patches welcome, or maybe we need to do a without-Moose rewrite.  At least
the test suite would be reusable, and probably a lot of the wire-level
stuff.

Or perhaps the Moose crew can fix it from their side?

Unfortunately I have about zero time to work on this myself.

On Thu, Sep 18, 2008 at 4:57 AM, Seth Daniel <proto...@sethdaniel.org>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Yuval Kogman  
View profile  
 More options Sep 25 2008, 9:02 am
From: Yuval Kogman <nothingm...@woobling.org>
Date: Thu, 25 Sep 2008 16:02:50 +0300
Local: Thurs, Sep 25 2008 9:02 am
Subject: Re: performance issues

On Thu, Sep 25, 2008 at 14:33:33 +0400, Brad Fitzpatrick wrote:
> Yeah, it appears that Moose is slow.  :-/
> Patches welcome, or maybe we need to do a without-Moose rewrite.  At least
> the test suite would be reusable, and probably a lot of the wire-level
> stuff.

> Or perhaps the Moose crew can fix it from their side?

Yes, most of it is very easy to fix using the same techniques we use
to make simple Moose accessors fast.

> Unfortunately I have about zero time to work on this myself.

Likewise in the short term, but I might be able to put some work
into it this weekend and probably more later.

I'd be more than happy to help out an interested person on IRC or
email.

--
  Yuval Kogman <nothingm...@woobling.org>
http://nothingmuch.woobling.org  0xEBD27418


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Seth Daniel  
View profile  
 More options Sep 25 2008, 9:24 am
From: Seth Daniel <proto...@sethdaniel.org>
Date: Thu, 25 Sep 2008 06:24:46 -0700
Local: Thurs, Sep 25 2008 9:24 am
Subject: Re: performance issues

On Thu, Sep 25, 2008 at 02:33:33PM +0400, Brad Fitzpatrick wrote:
> Yeah, it appears that Moose is slow.  :-/
> Patches welcome, or maybe we need to do a without-Moose rewrite.  At least
> the test suite would be reusable, and probably a lot of the wire-level
> stuff.

> Or perhaps the Moose crew can fix it from their side?

> Unfortunately I have about zero time to work on this myself.

Since writing that e-mail this has been released:

http://code.google.com/p/protobuf-perlxs/

I tested it out and it's very fast.  For those concerned primarily with
speed I'd recommend looking at it.  

--
seth /\ sethdaniel.org


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Seth Daniel  
View profile  
 More options Sep 25 2008, 9:55 am
From: Seth Daniel <proto...@sethdaniel.org>
Date: Thu, 25 Sep 2008 06:55:44 -0700
Local: Thurs, Sep 25 2008 9:55 am
Subject: Re: performance issues

On Thu, Sep 25, 2008 at 04:02:50PM +0300, Yuval Kogman wrote:

> On Thu, Sep 25, 2008 at 14:33:33 +0400, Brad Fitzpatrick wrote:
> > Yeah, it appears that Moose is slow.  :-/
> > Patches welcome, or maybe we need to do a without-Moose rewrite.  At least
> > the test suite would be reusable, and probably a lot of the wire-level
> > stuff.

> > Or perhaps the Moose crew can fix it from their side?

> Yes, most of it is very easy to fix using the same techniques we use
> to make simple Moose accessors fast.

What technique is that, exactly?

--
seth /\ sethdaniel.org


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Bunce  
View profile  
 More options Sep 25 2008, 9:57 am
From: Tim Bunce <Tim.Bu...@pobox.com>
Date: Thu, 25 Sep 2008 14:57:29 +0100
Local: Thurs, Sep 25 2008 9:57 am
Subject: Re: performance issues

On Wed, Sep 17, 2008 at 05:57:50PM -0700, Seth Daniel wrote:

> Hello,

> Where I work [1] we are thinking about using Protocol Buffers.  However we
> have found that the current perl implementation has some performance
> issues.  There has been at least one message to this list that touches
> on this:

> http://groups.google.com/group/protobuf-perl/browse_thread/thread/364...

> We are seeing the same issues.  Even for smaller messages (12k-20k) we
> are seeing 5-10 seconds for deserialization.  For messages with embedded
> messages the serialization also becomes very slow.

I don't have time to help much but I'd be very interested in studying the
results of running the code under Devel::NYTProf. If someone could put
up the html reports somewhere (or just email a tarball to me) I may be
able to help in some way. Even if only to help improve NYTProf to give
more insight into the performance of Moose based modules.

Tim.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Seth Daniel  
View profile  
 More options Sep 25 2008, 10:12 am
From: Seth Daniel <proto...@sethdaniel.org>
Date: Thu, 25 Sep 2008 07:12:52 -0700
Local: Thurs, Sep 25 2008 10:12 am
Subject: Re: performance issues

http://sethd.org/prof/simple/30s/index.html
http://sethd.org/prof/embed/54s/index.html

The results posted in the above links were achieved after applying the
following very simple patch to Class::MOP (patch is also attached):

--- MOP.pm  2008-08-29 15:24:01.000000000 -0700
+++ MOP.pm.new  2008-08-29 15:23:38.000000000 -0700
@@ -128,6 +128,7 @@

     if (ref($class) || !defined($class) || !length($class)) {
         my $display = defined($class) ? $class : 'undef';
+        die if $^S;
         confess "Invalid class name ($display)";
     }

@@ -137,12 +138,14 @@
         my $file = $class . '.pm';
         $file =~ s{::}{/}g;
         eval { CORE::require($file) };
+        die if( $^S && $@ );
         confess "Could not load class ($class) because : $@" if $@;
     }

     # initialize a metaclass if necessary
     unless (does_metaclass_exist($class)) {
         eval { Class::MOP::Class->initialize($class) };
+        die if( $^S && $@ );
         confess "Could not initialize class ($class) because : $@" if $@;
     }

Essentially an enormous amount of time was spent 'confess'ing.  Without this
patch deserialization would take *much* longer.  A 500k message was taking
around 10 minutes to deserialize.  With this patch the time went down to 30s
for a non-embedded message and 54s for an embedded message.  Of course, those
times are still really slow.

For comparison the perlxs generator can serialize a 1.5M message in around
.04s on my machine.

If you need un-patched results I can provide those easily enough.

--
seth /\ sethdaniel.org

  class_mop.patch
< 1K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Bunce  
View profile  
 More options Sep 25 2008, 5:22 pm
From: Tim Bunce <Tim.Bu...@pobox.com>
Date: Thu, 25 Sep 2008 22:22:53 +0100
Local: Thurs, Sep 25 2008 5:22 pm
Subject: Re: performance issues

On Thu, Sep 25, 2008 at 07:12:52AM -0700, Seth Daniel wrote:

> > I don't have time to help much but I'd be very interested in studying the
> > results of running the code under Devel::NYTProf. If someone could put
> > up the html reports somewhere (or just email a tarball to me) I may be
> > able to help in some way. Even if only to help improve NYTProf to give
> > more insight into the performance of Moose based modules.

> http://sethd.org/prof/simple/30s/index.html
> http://sethd.org/prof/embed/54s/index.html
> Essentially an enormous amount of time was spent 'confess'ing.  Without this
> patch deserialization would take *much* longer.  A 500k message was taking
> around 10 minutes to deserialize.  With this patch the time went down to 30s
> for a non-embedded message and 54s for an embedded message.  Of course, those
> times are still really slow.

Almost all that time is spent within this code:
http://sethd.org/prof/simple/30s/Moose-Meta-Attribute.pm-line.html#58

due to this one call to does():
http://sethd.org/prof/simple/30s/Protobuf-Meta-Message.pm-line.html#161

    if ($attr->does('Protobuf::Attribute::Field::Scalar')) {
        $attr->set_value($self, $value);
    } else {
        $attr->push_value($self, $value);
    }

Find some way to avoid calling does() and the performance will be *much*
better.

I don't know if anyone on the Moose list is here but it's clear that Moose
needs a good sprinkling of caching. Nothing too complex.  Invalidate
whenever anything structural changes. Just a simple matter of programming.

Tim.

p.s. NYTProf is amazing! :)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »