Skip to content
Tcl Source Code View Ticket
Login

View Ticket

lsort speed patch

Closed / Accepted1856994fffffffffffffffffffffffffffffffffCreated 19 years agoUpdated 19 years ago
Descriptionplain2007-12-23 16:40:39
Attached a patch that speeds up lsort between 5 and 10% (on mcvoy's test: sorting 1000000 lines of Tcl source).

The patch moves up some code that was run at each comparison, insuring that it is run just once per element.

Not committed as there is a tradeoff: the mem reqs go slightly up. There is one extra field in struct SortElement (from 3 to 4 fields).

Opinions?
msoferplain2007-12-23 23:40:39
File Added - 259563: cmdIL.diff
msoferplain2007-12-23 23:44:56
Logged In: YES 
user_id=148712
Originator: YES

Note: lsort itself is likely to improve much more; 5-10% is the improvement for the whole benchmark, which also does IO of the million lines.
dkfplain2007-12-24 00:23:23
Logged In: YES 
user_id=79902
Originator: NO

Looks like it's a workable strategy. Commit if you want.
msofer Closed ticket [1856994fff]. [History diff]2007-12-24 00:52:41
Log in (anonymous is fine) to add a comment.

Attachments: