Re: Speedup canvas itemconfigure -fill for many polygons.



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



.



Relevant Pages

  • Re: web services & firefox.
    ... security and SSL standards open in Bugzilla. ... Then in your <message tags remove the <part tags that rely on the <s ... > proxy and call it as if the webservice was a local object. ... > called (see error messages included in original post). ...
    (microsoft.public.dotnet.general)
  • Re: Get Value of Non-ASP.NET Control
    ... "Jonathan Wood" wrote in message ... control. ... So I write and tags to the output. ... the one I described in my original post. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Speedup canvas itemconfigure -fill for many polygons.
    ... 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 ...
    (comp.lang.tcl)
  • Re: Speedup canvas itemconfigure -fill for many polygons.
    ...  So forget my original post ... except that when using a lot of tags, it is much slower to address the ... Yes, this is due to the fact that lookup by id uses a hashtable, while ... Best would be to rewrite the canvas tag code to use hash tables ...
    (comp.lang.tcl)
  • Re: creating GUI of lines
    ... canvas boundaries, the lines are discontinuous. ... when we configure the widget, i need to change the line ... etc, is just to use a single text widget, and text tags to identify ...
    (comp.lang.tcl)