I have an application that generates a canvas with a large number of items in it. When it is building the canvas, I see it steadily slow down as it adds items. A typical instance may have several thousand items, each with multiple tags.
The bulk of the display is a grid of cells arranged in columns. Each cell can be clicked on to change its state. As implemented, each cell is composed of a number of items all in the same space.
I'm looking to make it more responsive.
I have several ideas that I want to try, but I thought I'd take the lazy approach and ask for any discovered wisdom.
My ideas:
Each canvas will contain a smaller number of items. My hope is that messing with items from a smaller list will reduce the time costs for access and update. The total number of items will not change; they will be spread among more containers instead of being piled in one.
Each button would be small and bear an image. Each column would be a Frame with the Buttons packed on the bottom.
I'd have to construct a suitable set of images, but each cell would only add one item instead of three or four as presently done.
I could use multiple canvases with images.
I do want to keep open the possibilities for selecting multiple cells for group actions, either by some variation on shift-click or by dragging a selection rectangle (or a diamond). I see this action as being a different operating mode from normal cell manipulation.
I'm open to pointers to FMs to R; I'll be examining Mastering Perl/Tk as well, for any clues it offers.
yours,
Michael
In reply to Perl Tk Canvas and buckets of items by herveus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |