Howdy!

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:

Multiple canvases

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.

No canvas; use frames and buttons

Each button would be small and bear an image. Each column would be a Frame with the Buttons packed on the bottom.

Replace multiple items with single images

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.

Combinations?

I could use multiple canvases with images.

Other considerations

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.