Tcl Source Code

View Ticket
Login
Ticket UUID: 1856994
Title: lsort speed patch
Type: Patch Version: None
Submitter: msofer Created on: 2007-12-23 16:40:39
Subsystem: 17. Commands I-L Assigned To: msofer
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2007-12-24 00:52:41
Resolution: Accepted Closed By: msofer
    Closed on: 2007-12-23 17:52:41
Description:
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?
User Comments: dkf added on 2007-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 added on 2007-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.

msofer added on 2007-12-23 23:40:39:

File Added - 259563: cmdIL.diff

Attachments: