Re: [Twisted-Python] transport.write performance.

2013-08-07 Thread Tristan Seligmann
On Wed, Aug 7, 2013 at 10:10 PM, Glyph wrote: > > > On Aug 7, 2013, at 1:06 PM, Laurens Van Houtven <_...@lvh.io> wrote: > > FWIW, Maciej commented that they don't expect to be *faster*, because they > actually care about the JSON spec or checking return values. Things which > ultrajson convenien

Re: [Twisted-Python] transport.write performance.

2013-08-07 Thread Glyph
On Aug 7, 2013, at 1:06 PM, Laurens Van Houtven <_...@lvh.io> wrote: > FWIW, Maciej commented that they don't expect to be *faster*, because they > actually care about the JSON spec or checking return values. Things which > ultrajson conveniently ignores :-) It's pretty easy to do the wrong thi

Re: [Twisted-Python] transport.write performance.

2013-08-07 Thread Laurens Van Houtven
On Wed, Aug 7, 2013 at 9:58 PM, Glyph wrote: > Just curious here: what version of PyPy did you do your tests with? From > what I've heard, the somewhat recently-released 2.1 should have improved > JSON parsing performance. > FWIW, Maciej commented that they don't expect to be *faster*, because

Re: [Twisted-Python] transport.write performance.

2013-08-07 Thread Glyph
On Aug 1, 2013, at 1:49 AM, zipxing wrote: > pypy+builtin_json performance < cpython+ultrajson Just curious here: what version of PyPy did you do your tests with? From what I've heard, the somewhat recently-released 2.1 should have improved JSON parsing performance. -glyph

Re: [Twisted-Python] transport.write performance.

2013-08-05 Thread zipxing
cpython+ujson   6s cpython+cjson   9s pypy+json       30s > From: zipx...@hotmail.com > To: twisted-python@twistedmatrix.com > Date: Mon, 5 Aug 2013 19:26:40 +0800 > Subject: Re: [Twisted-Python] transport.write performance.

Re: [Twisted-Python] transport.write performance.

2013-08-05 Thread zipxing
son 30s with pypy+json ________ > From: gl...@twistedmatrix.com > Date: Thu, 1 Aug 2013 09:46:54 -0700 > To: twisted-python@twistedmatrix.com > Subject: Re: [Twisted-Python] transport.write performance. > > > On Aug 1, 2013, at 1:49 AM, zipxing &g

Re: [Twisted-Python] transport.write performance.

2013-08-01 Thread L. Daniel Burr
Hi Glyph, On 8/1/13 11:46 AM, Glyph wrote: On Aug 1, 2013, at 1:49 AM, zipxing > wrote: pypy+builtin_json performance < cpython+ultrajson Do you have a reference to a benchmark confirming this? I'm curious about it. -glyph Here's one: http://liangnuren.wo

Re: [Twisted-Python] transport.write performance.

2013-08-01 Thread Glyph
On Aug 1, 2013, at 1:49 AM, zipxing wrote: > pypy+builtin_json performance < cpython+ultrajson Do you have a reference to a benchmark confirming this? I'm curious about it. -glyph ___ Twisted-Python mailing list Twisted-Python@twistedmatrix.com htt

Re: [Twisted-Python] transport.write performance.

2013-08-01 Thread zipxing
pypy+builtin_json performance < cpython+ultrajson > Date: Wed, 31 Jul 2013 09:22:53 +0200 > From: _...@lvh.io > To: twisted-python@twistedmatrix.com > Subject: Re: [Twisted-Python] transport.write performance. > > > On Jul 31

Re: [Twisted-Python] transport.write performance.

2013-07-31 Thread Laurens Van Houtven
> > From: _...@lvh.io > > Date: Tue, 30 Jul 2013 13:09:33 +0200 > > To: twisted-python@twistedmatrix.com > > Subject: Re: [Twisted-Python] transport.write performance. > > > > Hi zipxing, > > > > You don't mention the interpreter. Is i

Re: [Twisted-Python] transport.write performance.

2013-07-30 Thread zipxing
Great! pypy take 20% cpu, 3x fast than cpython! Thanks! A little problem: cjson and ujson can't install to pypy... ZipXing > From: _...@lvh.io > Date: Tue, 30 Jul 2013 13:09:33 +0200 > To: twisted-python@twistedmatrix.com > Subject: Re

Re: [Twisted-Python] transport.write performance.

2013-07-30 Thread Laurens Van Houtven
On Tue, Jul 30, 2013 at 3:31 PM, Phil Mayers wrote: > Obviously if the OP using "send" without checking the return value, > they're doing it wrong! > Right, but that's what the OP's example does :) cheers lvh ___ Twisted-Python mailing list Twisted-Pyt

Re: [Twisted-Python] transport.write performance.

2013-07-30 Thread Phil Mayers
On 30/07/13 13:55, Laurens Van Houtven wrote: On Tue, Jul 30, 2013 at 2:44 PM, Phil Mayers mailto:p.may...@imperial.ac.uk>> wrote: For TCP? Yes. See also the difference between socket.send and socket.sendall :) socket.send returns a number of bytes that it actually sent. Sure - FD write

Re: [Twisted-Python] transport.write performance.

2013-07-30 Thread Laurens Van Houtven
On Tue, Jul 30, 2013 at 2:44 PM, Phil Mayers wrote: > For TCP? > Yes. See also the difference between socket.send and socket.sendall :) socket.send returns a number of bytes that it actually sent. cheers lvh ___ Twisted-Python mailing list Twisted-Pyt

Re: [Twisted-Python] transport.write performance.

2013-07-30 Thread Phil Mayers
On 30/07/13 10:31, exar...@twistedmatrix.com wrote: `transport.write` will actually try to deliver your data. `send` will as likely drop it on the floor as deliver it. For TCP? ___ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http:/

Re: [Twisted-Python] transport.write performance.

2013-07-30 Thread Laurens Van Houtven
Hi zipxing, You don't mention the interpreter. Is it CPython? What kind of results do you get trying it on PyPy? Also, you don't need to specify epollreactor. Recent versions of twisted will automagically choose the appropriate backend. I fixed this and some other cleanups and got: from tim

Re: [Twisted-Python] transport.write performance.

2013-07-30 Thread exarkun
On 08:54 am, zipx...@hotmail.com wrote: A simple TCP echo server using epoll reactor:this server process take 60% cpu on 4000 request/s. If use self.transport.getHandle().send instead of self.transport.write,it take 30% cpu on 4000 request/s. Why transport.write take more user cpu?Why twisted p

Re: [Twisted-Python] transport.write performance.

2013-07-30 Thread zipxing
tsvr.py --- import sys, time, random, socket, traceback from twisted.internet import epollreactor epollreactor.install() from twisted.internet import defer, reactor, task from twisted.internet.protocol import Protocol, Factory from protocol im

[Twisted-Python] transport.write performance.

2013-07-30 Thread zipxing
A simple TCP echo server using epoll reactor:this server process take 60% cpu on 4000 request/s. If use self.transport.getHandle().send instead of self.transport.write,it take 30% cpu on 4000 request/s. Why transport.write take more user cpu?Why twisted performance so poor?(echosvr.c using libev