[Python-talk] Profile results... Better pack?

Kent Johnson kent37 at tds.net
Thu Oct 15 12:58:47 EDT 2009


On Thu, Oct 15, 2009 at 11:50 AM,  <bruce.labitt at autoliv.com> wrote:

> I guess first order of business is to work on packing...
>
> Is there a faster packer?  I need to generate a string that is the
> concatenation of:
>
> 1 16 bit number byte swapped + 1084200 doubles byte swapped
>
> The byte swapping is to get into network order.

Can you show your code? I suggest you post this specific question to
comp.lang.python with a code sample of what you are doing now. Even
better would be a short, standalone program that demonstrates the
timing. That newsgroup loves optimization questions.

> Can I use the module array?

It looks promising, it does have byteswap() and tofile() methods...

Kent


More information about the Python-talk mailing list