Speed comparison

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Speed comparison

Thijs Triemstra
Hi,

Nick took the time to write a a great article about PyAMF's performance, check it out at http://blog.pyamf.org/2010/08/a-brief-history-of-speed

I wonder though whether PyAMF is faster then amfast nowadays..? :)

Cheers,

Thijs
_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users

PGP.sig (201 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Speed comparison

Andrew Gartland
A nice scientific comparison! Thank you for all your work.

Speaking of standing on the shoulders of giants though, i've been
using PyAmf quite successfully for a while now and never even had to
think about versions, performance issues or anything going on under
the hood....that was your goal i'm sure! but now i want to make sure I
am making best use of your hard work. How do I know verify that I am
using the c-extensions? I figured out that i can check the pyamf
version here:

import pyamf
pyamf.__version__

and i know i am using the Amf3 data types because I use:

from pyamf import amf3

but is there a way to make sure I am using the c-extensions? does it
require any additional dependencies? you mention that using version
0.6 employs them by default so does that mean that if i am using the
TwistedGateway remoting service that i'm good to go?

thanks for the tips!

Andrew


On Mon, Aug 16, 2010 at 9:54 AM, Thijs Triemstra | Collab
<[hidden email]> wrote:

> Hi,
>
> Nick took the time to write a a great article about PyAMF's performance, check it out at http://blog.pyamf.org/2010/08/a-brief-history-of-speed
>
> I wonder though whether PyAMF is faster then amfast nowadays..? :)
>
> Cheers,
>
> Thijs
> _______________________________________________
> PyAMF users mailing list - [hidden email]
> http://lists.pyamf.org/mailman/listinfo/users
>
>
_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Speed comparison

Nick Joyce
cpyamf is a separate python package to pyamf, so a simple import test will tell you if you are using the c-extensions or not.

One gotcha: If you are using the Encoder/Decoder classes in specialised ways then you need to be careful at how you instantiate them. The check for using the C extensions is done in pyamf (the top level python package), not pyamf.amf3/0. An example:

import pyamf.amf3

x = pyamf.amf3.Encoder() # this is the pure python version
y = pyamf.get_encoder(pyamf.AMF3) # if the c extension is enabled you will get that

print repr(x) # <pyamf.amf3.Encoder object at 0x10214dcd0>
print repr(y) # <cpyamf.amf3.Encoder object at 0x10214be50>

Notice the top level package.

I had attempted to weave cpyamf through pyamf and have pyamf.amf3.Encoder be replaced with the C equivalent but it became a circular import nightmare.

So, in short, use the top level helper functions if you want to use the C extensions. The gateway/remoting packages are aware of this and act accordingly. If you have cpyamf installed and just instantiate TwistedGateway, you will automatically get the speedups.

Cheers,

Nick

On 17 Aug 2010, at 03:34, Andrew Gartland wrote:

> A nice scientific comparison! Thank you for all your work.
>
> Speaking of standing on the shoulders of giants though, i've been
> using PyAmf quite successfully for a while now and never even had to
> think about versions, performance issues or anything going on under
> the hood....that was your goal i'm sure! but now i want to make sure I
> am making best use of your hard work. How do I know verify that I am
> using the c-extensions? I figured out that i can check the pyamf
> version here:
>
> import pyamf
> pyamf.__version__
>
> and i know i am using the Amf3 data types because I use:
>
> from pyamf import amf3
>
> but is there a way to make sure I am using the c-extensions? does it
> require any additional dependencies? you mention that using version
> 0.6 employs them by default so does that mean that if i am using the
> TwistedGateway remoting service that i'm good to go?
>
> thanks for the tips!
>
> Andrew
>
>
> On Mon, Aug 16, 2010 at 9:54 AM, Thijs Triemstra | Collab
> <[hidden email]> wrote:
>> Hi,
>>
>> Nick took the time to write a a great article about PyAMF's performance, check it out at http://blog.pyamf.org/2010/08/a-brief-history-of-speed
>>
>> I wonder though whether PyAMF is faster then amfast nowadays..? :)
>>
>> Cheers,
>>
>> Thijs
>> _______________________________________________
>> PyAMF users mailing list - [hidden email]
>> http://lists.pyamf.org/mailman/listinfo/users
>>
>>
> _______________________________________________
> PyAMF users mailing list - [hidden email]
> http://lists.pyamf.org/mailman/listinfo/users

_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Speed comparison

Vishal Rana-2
I got it.

Sent from my iPhone

On Aug 16, 2010, at 5:13 PM, Nick Joyce <[hidden email]> wrote:

> cpyamf is a separate python package to pyamf, so a simple import test will tell you if you are using the c-extensions or not.
>
> One gotcha: If you are using the Encoder/Decoder classes in specialised ways then you need to be careful at how you instantiate them. The check for using the C extensions is done in pyamf (the top level python package), not pyamf.amf3/0. An example:
>
> import pyamf.amf3
>
> x = pyamf.amf3.Encoder() # this is the pure python version
> y = pyamf.get_encoder(pyamf.AMF3) # if the c extension is enabled you will get that
>
> print repr(x) # <pyamf.amf3.Encoder object at 0x10214dcd0>
> print repr(y) # <cpyamf.amf3.Encoder object at 0x10214be50>
>
> Notice the top level package.
>
> I had attempted to weave cpyamf through pyamf and have pyamf.amf3.Encoder be replaced with the C equivalent but it became a circular import nightmare.
>
> So, in short, use the top level helper functions if you want to use the C extensions. The gateway/remoting packages are aware of this and act accordingly. If you have cpyamf installed and just instantiate TwistedGateway, you will automatically get the speedups.
>
> Cheers,
>
> Nick
>
> On 17 Aug 2010, at 03:34, Andrew Gartland wrote:
>
>> A nice scientific comparison! Thank you for all your work.
>>
>> Speaking of standing on the shoulders of giants though, i've been
>> using PyAmf quite successfully for a while now and never even had to
>> think about versions, performance issues or anything going on under
>> the hood....that was your goal i'm sure! but now i want to make sure I
>> am making best use of your hard work. How do I know verify that I am
>> using the c-extensions? I figured out that i can check the pyamf
>> version here:
>>
>> import pyamf
>> pyamf.__version__
>>
>> and i know i am using the Amf3 data types because I use:
>>
>> from pyamf import amf3
>>
>> but is there a way to make sure I am using the c-extensions? does it
>> require any additional dependencies? you mention that using version
>> 0.6 employs them by default so does that mean that if i am using the
>> TwistedGateway remoting service that i'm good to go?
>>
>> thanks for the tips!
>>
>> Andrew
>>
>>
>> On Mon, Aug 16, 2010 at 9:54 AM, Thijs Triemstra | Collab
>> <[hidden email]> wrote:
>>> Hi,
>>>
>>> Nick took the time to write a a great article about PyAMF's performance, check it out at http://blog.pyamf.org/2010/08/a-brief-history-of-speed
>>>
>>> I wonder though whether PyAMF is faster then amfast nowadays..? :)
>>>
>>> Cheers,
>>>
>>> Thijs
>>> _______________________________________________
>>> PyAMF users mailing list - [hidden email]
>>> http://lists.pyamf.org/mailman/listinfo/users
>>>
>>>
>> _______________________________________________
>> PyAMF users mailing list - [hidden email]
>> http://lists.pyamf.org/mailman/listinfo/users
>
> _______________________________________________
> PyAMF users mailing list - [hidden email]
> http://lists.pyamf.org/mailman/listinfo/users
_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users