Artifacts Associated With Ticket 231523ffffffffffffffffffffffffffffffffff
Ticket change [bdfb371da1] (rid 101998) by dkf on 2001-02-08 11:56:00:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
When you feed a 5MB string into [split ... ""], it creates a completely new Tcl_Obj for each character (that's a cost of at least 120MB on a 32-bit architecture!) Surely it should be possible and even imperative that some kind of sharing between character strings should happen in this case? Even just doing this for the ASCII subset or the first UNICODE page (i.e. to better handle binary data) would be an immense benefit in the normal case.
- foundin initialized to: "obsolete: 8.4a2"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "dkf"
- subsystem initialized to: "18. Commands M-Z"
- title initialized to: "[split $longString ""] uses far too much memory"
- type initialized to: "Bug"
Ticket change [a7c7848b75] (rid 98865) by dkf on 2001-02-09 18:08:00:
- assignee changed to: "dkf"
- icomment:
I've got a modification that makes this much faster for large strings (two seconds vs. two minutes unmodified) while still passing all the test suite. It works by using a hash to map from characters to the objects to put in the result list.
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
Ticket change [3d82543833] (rid 121102) by dkf on 2001-02-09 18:12:24:
- 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 - login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [14d2525f80] (rid 124465) by nobody on 2001-02-10 07:31:06:
- icomment:
See http://mini.net/cgi-bin/wikit/1245.html.
- login: "nobody"
- mimetype: "text/plain"
- username: "nobody"
- icomment:
Ticket change [ece1d04e5c] (rid 103782) by dkf on 2001-02-16 16:29:04:
- resolution changed to: "Fixed"
Ticket change [d4878a43b2] (rid 123462) by dkf on 2001-02-16 16:29:27:
- closedate changed to: "2001-02-16T09:29:27"
- closer changed to: "dkf"
- status changed to: "Closed"