Protocol buffers performance in python

741 views
Skip to first unread message

Baruch Oxman

unread,
Jan 20, 2010, 8:04:11 AM1/20/10
to Protocol Buffers
Hi !

I'm interested in using Protocol buffers for serialization of data
passed between Python and C++ processes.
I've seen some posts on performance comparison of different python
serializes, saying that the performance of google protocols
implementation for python is much worse than in C++.

Was any work done on this recently to improve the performance on
python ?
Is such work planned in the future ?

Kenton Varda

unread,
Jan 20, 2010, 3:45:37 PM1/20/10
to Baruch Oxman, Protocol Buffers
In 2.3.0, the Python implementation is now 10x-25x faster than it used to be.  However, as the implementation is pure-python, it is still much slower than C++.  Petar (author of much of the Python code) is currently working on a version of the Python implementation which wraps the C++ library in the hope of improving this further.

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To post to this group, send email to prot...@googlegroups.com.
To unsubscribe from this group, send email to protobuf+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.




achepikau

unread,
Mar 11, 2010, 6:28:25 AM3/11/10
to Protocol Buffers
Hi, Kenton

I am using Python Protobuffers library as exchange format between game
client (C++ Windows application) and game server (Python socket server
based on Twisted framework).
After upgrade from 2.0.1 to 2.3.0 we got 4x-6x performance boost
(python 2.5.2, Ubuntu 8.04) - it's great!
Do you know about Petar's timeline for the new version with more power
for Python code?

On Jan 20, 10:45 pm, Kenton Varda <ken...@google.com> wrote:
> In 2.3.0, the Python implementation is now 10x-25x faster than it used to
> be.  However, as the implementation is pure-python, it is still much slower
> than C++.  Petar (author of much of the Python code) is currently working on
> a version of the Python implementation which wraps the C++ library in the
> hope of improving this further.
>

> On Wed, Jan 20, 2010 at 5:04 AM, Baruch Oxman <baruch.ox...@gmail.com>wrote:
>
> > Hi !
>
> > I'm interested in using Protocol buffers for serialization of data
> > passed between Python and C++ processes.
> > I've seen some posts on performance comparison of different python
> > serializes, saying that the performance of google protocols
> > implementation for python is much worse than in C++.
>
> > Was any work done on this recently to improve the performance on
> > python ?
> > Is such work planned in the future ?
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Protocol Buffers" group.
> > To post to this group, send email to prot...@googlegroups.com.
> > To unsubscribe from this group, send email to

> > protobuf+u...@googlegroups.com<protobuf%2Bunsu...@googlegroups.com>

Kenton Varda

unread,
Mar 12, 2010, 1:05:07 PM3/12/10
to achepikau, Petar Petrov, Protocol Buffers
The work is going slowly because the Python C extension API has lots of subtle quirks.  The good news is that Google has Python implementation experts who are reviewing the code.  But this is "20% work" for everyone involved (i.e. not their real jobs) so it will take awhile.

My hope is that we'll be able to release it in a couple months.

To unsubscribe from this group, send email to protobuf+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages