Re: [Qemu-devel] [RFC][PATCH] signrom: Speed up checksum calculation

2012-01-24 Thread Christoph Egger
On 01/23/12 20:16, Stefan Weil wrote: Am 23.01.2012 19:38, schrieb Jan Kiszka: Forking an expr process for every byte of the input data slows down the checksum calculation massively. Fix this while still remaining portable by implementing the algorithm in awk. Signed-off-by: Jan Kiszka --- Tha

Re: [Qemu-devel] [RFC][PATCH] signrom: Speed up checksum calculation

2012-01-24 Thread Andreas Färber
Am 23.01.2012 21:37, schrieb Anthony Liguori: > On 01/23/2012 02:32 PM, Jan Kiszka wrote: >> On 2012-01-23 21:08, Anthony Liguori wrote: >>> I've been thinking that we could potentially rewrite a large chunk >>> (all?) of configure in python too since we have such a hard >>> dependency now. >> >> S

Re: [Qemu-devel] [RFC][PATCH] signrom: Speed up checksum calculation

2012-01-24 Thread Paolo Bonzini
On 01/23/2012 07:38 PM, Jan Kiszka wrote: nums=`od -A n -t u1 -v -N $size "$1"` -for i in ${nums}; do -# add each byte's value to sum -sum=`expr \( $sum + $i \) % 256` -done - -sum=$(( (256 - $sum) % 256 )) We have a bashism here, so why not do sum=$(( ($sum + $i) % 256 )) and do

Re: [Qemu-devel] [RFC][PATCH] signrom: Speed up checksum calculation

2012-01-24 Thread Paolo Bonzini
On 01/23/2012 09:08 PM, Anthony Liguori wrote: QEMU depends on Python = Python 2 for QAPI, tracing and maybe more. See scripts/*.py. I've been thinking that we could potentially rewrite a large chunk (all?) of configure in python too since we have such a hard dependency now. What would the a

Re: [Qemu-devel] [RFC][PATCH] signrom: Speed up checksum calculation

2012-01-23 Thread Stefan Weil
On 01/23/2012 02:32 PM, Jan Kiszka wrote: On 2012-01-23 21:08, Anthony Liguori wrote: I've been thinking that we could potentially rewrite a large chunk (all?) of configure in python too since we have such a hard dependency now. [snip] However, I will now write signrom.py. That's much shorte

Re: [Qemu-devel] [RFC][PATCH] signrom: Speed up checksum calculation

2012-01-23 Thread Anthony Liguori
On 01/23/2012 02:32 PM, Jan Kiszka wrote: On 2012-01-23 21:08, Anthony Liguori wrote: On 01/23/2012 01:25 PM, Stefan Weil wrote: Am 23.01.2012 20:19, schrieb Jan Kiszka: On 2012-01-23 20:16, Stefan Weil wrote: Am 23.01.2012 19:38, schrieb Jan Kiszka: [snip] What about replacing the whole s

Re: [Qemu-devel] [RFC][PATCH] signrom: Speed up checksum calculation

2012-01-23 Thread Jan Kiszka
On 2012-01-23 21:08, Anthony Liguori wrote: > On 01/23/2012 01:25 PM, Stefan Weil wrote: >> Am 23.01.2012 20:19, schrieb Jan Kiszka: >>> On 2012-01-23 20:16, Stefan Weil wrote: Am 23.01.2012 19:38, schrieb Jan Kiszka: >> [snip] What about replacing the whole script by a python script

Re: [Qemu-devel] [RFC][PATCH] signrom: Speed up checksum calculation

2012-01-23 Thread Anthony Liguori
On 01/23/2012 01:25 PM, Stefan Weil wrote: Am 23.01.2012 20:19, schrieb Jan Kiszka: On 2012-01-23 20:16, Stefan Weil wrote: Am 23.01.2012 19:38, schrieb Jan Kiszka: [snip] What about replacing the whole script by a python script? That would save about 6 more forks :-) I think we have no py

Re: [Qemu-devel] [RFC][PATCH] signrom: Speed up checksum calculation

2012-01-23 Thread Stefan Weil
Am 23.01.2012 20:19, schrieb Jan Kiszka: On 2012-01-23 20:16, Stefan Weil wrote: Am 23.01.2012 19:38, schrieb Jan Kiszka: [snip] What about replacing the whole script by a python script? That would save about 6 more forks :-) I think we have no python dependency in the build system yet - wh

Re: [Qemu-devel] [RFC][PATCH] signrom: Speed up checksum calculation

2012-01-23 Thread Jan Kiszka
On 2012-01-23 20:16, Stefan Weil wrote: > Am 23.01.2012 19:38, schrieb Jan Kiszka: >> Forking an expr process for every byte of the input data slows down the >> checksum calculation massively. Fix this while still remaining portable >> by implementing the algorithm in awk. >> >> Signed-off-by: Jan

Re: [Qemu-devel] [RFC][PATCH] signrom: Speed up checksum calculation

2012-01-23 Thread Stefan Weil
Am 23.01.2012 19:38, schrieb Jan Kiszka: Forking an expr process for every byte of the input data slows down the checksum calculation massively. Fix this while still remaining portable by implementing the algorithm in awk. Signed-off-by: Jan Kiszka --- That "remaining portable" is an unproven c

[Qemu-devel] [RFC][PATCH] signrom: Speed up checksum calculation

2012-01-23 Thread Jan Kiszka
Forking an expr process for every byte of the input data slows down the checksum calculation massively. Fix this while still remaining portable by implementing the algorithm in awk. Signed-off-by: Jan Kiszka --- That "remaining portable" is an unproven claim. So please check that problematic Net