Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 3d82543833b438532617e3315f3936c0d1201e66
Ticket: 231523ffffffffffffffffffffffffffffffffff
[split $longString ""] uses far too much memory
User & Date: dkf on 2001-02-09 18:12:24
Changes

  1. icomment:
    My goodness!  Further testing indicates this is a speedup even for shorter strings.  First, for comparison the tclsh8.3 version which used the old algorithm I believe:
      $ tclsh8.3
      % set s "This is a long string to type but a short string to split."
      This is a long string to type but a short string to split.
      % time {split $s {}} 10000
      229 microseconds per iteration
    Now the new version using my changed code:
      $ /tmp/bin/tclsh8.4 
      % set s "This is a long string to type but a short string to split."
      This is a long string to type but a short string to split.
      % time {split $s {}} 10000
      181 microseconds per iteration
    
    
    
  2. login: "dkf"
  3. mimetype: "text/plain"
  4. username: "dkf"