Re: Speedup canvas itemconfigure -fill for many polygons.
- From: Alexandre Ferrieux <alexandre.ferrieux@xxxxxxxxx>
- Date: Mon, 31 Mar 2008 01:34:17 -0700 (PDT)
On Mar 31, 8:31 am, Mats <mats...@xxxxxxxxx> wrote:
On 31 Mar, 00:41, Alexandre Ferrieux <alexandre.ferri...@xxxxxxxxx>
wrote:
On Mar 30, 10:18 pm, max vorticity <max.vortic...@xxxxxxxxxxx> wrote:
I had an error in my analysis so the slowness is not really
attributable to the itemconfigure command. So forget my original post
except that when using a lot of tags, it is much slower to address the
items by individual tags for each polygon than by the original canvas
id
Yes, this is due to the fact that lookup by id uses a hashtable, while
lookup by tag implies a linear search.
Best would be to rewrite the canvas tag code to use hash tables
instead but
I haven't done that (yet) in tkp::canvas.
By the way Mats, what's the plan regarding tkp ? Is the goal to keep
compatibility with vanilla canvas, and then to merge, or is it forking
just like Ttk lives side-by-side with legacy Tk widgets ?
Any ideas of how that code should work?
Curious you ask that, you're the expert :-)
To do this I'd just add proper housekeeping code to keep the hashtable
in sync with added/removed tags and items, just like any inverse
function implementation. Now how hard it is to identify all places
where that housekeeping must be done, dunno. Surely you have an idea !
-Alex
.
- Follow-Ups:
- References:
- Speedup canvas itemconfigure -fill for many polygons.
- From: max vorticity
- Re: Speedup canvas itemconfigure -fill for many polygons.
- From: Alexandre Ferrieux
- Re: Speedup canvas itemconfigure -fill for many polygons.
- From: max vorticity
- Re: Speedup canvas itemconfigure -fill for many polygons.
- From: Alexandre Ferrieux
- Re: Speedup canvas itemconfigure -fill for many polygons.
- From: Mats
- Speedup canvas itemconfigure -fill for many polygons.
- Prev by Date: Re: Update using teacup
- Next by Date: Re: Problem on frame widget
- Previous by thread: Re: Speedup canvas itemconfigure -fill for many polygons.
- Next by thread: Re: Speedup canvas itemconfigure -fill for many polygons.
- Index(es):
Relevant Pages
|