Klaas wrote:
> Klaas wrote:
>
> > In fact, you can make it about 4x faster by balancing:
> >
> > [EMAIL PROTECTED] ~]$ python -m timeit -s "from array import array"
> > "array('c','\0'*200)*500"
> > 1 loops, best of 3: 32.4 usec per loop
>
> This is an unclean minimally-tested patch which achi
Klaas wrote:
> In fact, you can make it about 4x faster by balancing:
>
> [EMAIL PROTECTED] ~]$ python -m timeit -s "from array import array"
> "array('c','\0'*200)*500"
> 1 loops, best of 3: 32.4 usec per loop
This is an unclean minimally-tested patch which achieves reasonable
performance (
John Machin wrote:
> Thanks, that's indeed faster than array(t, [v]*n) but what I had in
> mind was something like an additional constructor:
>
> array.filledarray(typecode, repeat_value, repeat_count)
>
> which I speculate should be even faster. Looks like I'd better get a
> copy of arraymodule.c
John Machin wrote:
> Thanks, that's indeed faster than array(t, [v]*n) but what I had in
> mind was something like an additional constructor:
>
> array.filledarray(typecode, repeat_value, repeat_count)
>
> which I speculate should be even faster.
before you add a new API, you should probably st
Fredrik Lundh wrote:
> John Machin wrote:
>
> > I'm extremely agnostic about the spelling :-) IOW I'd be very glad of
> > any way [pure Python; e.g. maintaining my own version of the array
> > module doesn't qualify] to simply and rapidly create an array.array
> > instance with typecode t and numbe
Fredrik Lundh wrote:
> John Machin wrote:
>
>> I'm extremely agnostic about the spelling :-) IOW I'd be very glad of
>> any way [pure Python; e.g. maintaining my own version of the array
>> module doesn't qualify] to simply and rapidly create an array.array
>> instance with typecode t and number
John Machin wrote:
> I'm extremely agnostic about the spelling :-) IOW I'd be very glad of
> any way [pure Python; e.g. maintaining my own version of the array
> module doesn't qualify] to simply and rapidly create an array.array
> instance with typecode t and number of elements n with each elemen
Peter Otten wrote:
> Peter Otten wrote:
>
> > Leo Kislov wrote:
> >
> >>
> >> Peter Otten wrote:
> >>> Peter Otten wrote:
> >>>
> >>> > HYRY wrote:
> >>> >
> >>> >> I want to join two mono wave file to a stereo wave file by only using
> >>> >> the default python module.
> >>> >> Here is my program
HYRY wrote:
> Peter Otten wrote:
> > HYRY wrote:
> >
> > > I want to join two mono wave file to a stereo wave file by only using
> > > the default python module.
> > > Here is my program, but it is much slower than the C version, so how
> > > can I increase the speed?
> > > I think the problem is a
Peter Otten wrote:
> Leo Kislov wrote:
>
>>
>> Peter Otten wrote:
>>> Peter Otten wrote:
>>>
>>> > HYRY wrote:
>>> >
>>> >> I want to join two mono wave file to a stereo wave file by only using
>>> >> the default python module.
>>> >> Here is my program, but it is much slower than the C version,
Leo Kislov wrote:
>
> Peter Otten wrote:
>> Peter Otten wrote:
>>
>> > HYRY wrote:
>> >
>> >> I want to join two mono wave file to a stereo wave file by only using
>> >> the default python module.
>> >> Here is my program, but it is much slower than the C version, so how
>> >> can I increase the
Peter Otten wrote:
> Peter Otten wrote:
>
> > HYRY wrote:
> >
> >> I want to join two mono wave file to a stereo wave file by only using
> >> the default python module.
> >> Here is my program, but it is much slower than the C version, so how
> >> can I increase the speed?
> >> I think the problem
Peter Otten wrote:
> HYRY wrote:
>
>> I want to join two mono wave file to a stereo wave file by only using
>> the default python module.
>> Here is my program, but it is much slower than the C version, so how
>> can I increase the speed?
>> I think the problem is at line #1, #2, #3.
>
>> oarray
Peter Otten wrote:
> HYRY wrote:
>
> > I want to join two mono wave file to a stereo wave file by only using
> > the default python module.
> > Here is my program, but it is much slower than the C version, so how
> > can I increase the speed?
> > I think the problem is at line #1, #2, #3.
>
> > oa
I think
oarray = array.array("h", [0]*(len(larray)+len(rarray))) #1
oarray[0::2] = larray#2
oarray[1::2] = rarray#3
will be executed at C level, but if I use itertools, the program is
executed at Python level. So the itertools
HYRY wrote:
> I want to join two mono wave file to a stereo wave file by only using
> the default python module.
> Here is my program, but it is much slower than the C version, so how
> can I increase the speed?
> I think the problem is at line #1, #2, #3.
> oarray = array.array("h", [0]*(len(lar
HYRY wrote:
> I want to join two mono wave file to a stereo wave file by only using
> the default python module.
> Here is my program, but it is much slower than the C version, so how
> can I increase the speed?
> I think the problem is at line #1, #2, #3.
> oarray = array.array("h", [0]*(len(lar
"HYRY" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>I want to join two mono wave file to a stereo wave file by only using
> the default python module.
> Here is my program, but it is much slower than the C version, so how
> can I increase the speed?
> I think the problem is at line
I want to join two mono wave file to a stereo wave file by only using
the default python module.
Here is my program, but it is much slower than the C version, so how
can I increase the speed?
I think the problem is at line #1, #2, #3.
import wave
import array
lfile = wave.open(lfilename)
rfile = w
19 matches
Mail list logo