On Oct 5, 2:39 pm, Will Hall wrote:
> On Oct 3, 8:19 am, Roy Smith wrote:
>
>
>
> > My local news feed seems to have lost the early part of this thread, so
> > I'm afraid I don't know who I'm quoting here:
>
> > > My understanding is that appending to a list and then joining
> > > this list when
On Oct 3, 8:19 am, Roy Smith wrote:
> My local news feed seems to have lost the early part of this thread, so
> I'm afraid I don't know who I'm quoting here:
>
> > My understanding is that appending to a list and then joining
> > this list when done is the fastest technique for string
> > concaten
My local news feed seems to have lost the early part of this thread, so
I'm afraid I don't know who I'm quoting here:
> My understanding is that appending to a list and then joining
> this list when done is the fastest technique for string
> concatenation. Is this true?
>
> The 3 string concaten
[email protected] wrote:
> My understanding is that appending to a list and then joining
> this list when done is the fastest technique for string
> concatenation. Is this true?
>
> The 3 string concatenation techniques I can think of are:
>
> - append to list, join
> - string 'addition' (s = s
On Sat, 02 Oct 2010 13:17:02 -0700, Carey Tilden wrote:
> Have you profiled an application and found string concatenation to be
> a performance bottleneck? I would be surprised, but it's always
> possible. If not, I'd suggest you choose the technique that is most
> clear and concise, and worry a
Carey,
> Have you profiled an application and found string concatenation to be a
> performance bottleneck? I would be surprised, but it's always possible.
The "application" is very simple - its essentially a finite state
machine that parses complex RTF files. We read char by char and do lots
of
Emile,
> Your times will improve when not burdened by the repeated method lookups and
> element-wise list creation.
Excellent point!!
Here's updated timings for each technique followed by copy and paste
source code for anyone that wants to fiddle with these tests. I've
placed your name above yo
On Sat, Oct 2, 2010 at 12:09 PM, wrote:
> My understanding is that appending to a list and then joining this list when
> done is the fastest technique for string concatenation. Is this true?
Have you profiled an application and found string concatenation to be
a performance bottleneck? I would
On 10/2/2010 12:09 PM [email protected] said...
Your times will improve when not burdened by the repeated method lookups
and element-wise list creation:
try with eg,
def testListAppend2():
output = list()
append = output.append
for char in source:
append( char )
outpu