For Programmers: Free Programming Magazines  


Home > Archive > Tcl > January 2006 > [split $longstring {}]









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author [split $longstring {}]
Andreas Leitgeb

2006-01-27, 3:59 am

Kaitzschu <kaitzschu@kaitzschu.cjb.net.nospam.plz.invalid> wrote:
> split {abcdefghijklmnopqrstuvwxyz} {}


I wonder, if for (very) long strings e.g. > 100000 and more
it would be worth the trouble to reuse the Tcl_Objects for
the single characters, or whether this is already happening.

Just like with [binary scan $longdata c* var].
suchenwi

2006-01-27, 3:59 am

It is happening, for several years now already :^)

Donal K. Fellows

2006-01-27, 3:59 am

Actually, I made that optimization work for [split ... {}] first. The
[binary scan] one came later (and was much harder to write too).

Donal.

Andreas Leitgeb

2006-01-27, 7:59 am

Donal K. Fellows <donal.k.fellows@man.ac.uk> wrote:
> Actually, I made that optimization work for [split ... {}] first. The
> [binary scan] one came later (and was much harder to write too).
> Donal.


Sorry, I mixed it up with a situation discussed last year
about split. (but that was about split with non-empty
split-chars, and is unrelated to this case.)

Donal K. Fellows

2006-01-27, 7:59 am

Andreas Leitgeb wrote:
> Sorry, I mixed it up with a situation discussed last year
> about split. (but that was about split with non-empty
> split-chars, and is unrelated to this case.)


That's the case which isn't optimized on the grounds that it is probably
not worth doing on the normal lengths of data and frequencies of words
that people use.

Donal.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com