Tk Library Source Code

View Ticket
Login
Ticket UUID: 1472443
Title: bwidget - fix for several causes of ListBox slowness
Type: Patch Version: None
Submitter: jepler Created on: 2006-04-18 16:19:52
Subsystem: bwidget Assigned To: hobbs
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2007-11-01 01:13:57
Resolution: Fixed Closed By: hobbs
    Closed on: 2007-10-31 18:13:57
Description:
The bwidget 1.7 ListBox has several pieces of code that
lead to O(N**2) time to insert N items into a new
ListBox, and then display them (execute 'update')

I made the following timings before and after my patch:

#items time (ms)  ms/item
  4000     5842    1.460
  8000    24053    3.007
 16000    90522    5.658
 
  4000     1303    0.326
  8000     2599    0.325
 16000     5304    0.332

For 16000 items, the speedup is about 17x.  Because
ms/item is nearly constant for different item counts,
the performance is probably O(N).

This patch is against the 1.7 ListBox, but before
submitting I tested with the CVS version of listbox.tcl
and found that the N-squared performance problem still
exists.  I believe this patch is "of interest" even if
it doesn't automatically apply.
User Comments: hobbs added on 2007-11-01 01:13:57:
Logged In: YES 
user_id=72656
Originator: NO

Added to bwidgets

jepler added on 2006-04-18 23:23:18:

File Added - 174985: lbs.tcl

jepler added on 2006-04-18 23:23:17:
Logged In: YES 
user_id=2772

I'm using bwidget with tcl/tk8.4.10.  There are still
N-squared behaviors with "-selectfill 1".

jepler added on 2006-04-18 23:19:54:

File Added - 174984: listbox-speed.patch

Attachments: