Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Strange timings behavior

49 views
Skip to first unread message

Gerhard Reithofer

unread,
Apr 2, 2017, 11:08:04 AM4/2/17
to
Hi TCLers,
I'm working on a tool which uses tablellist and various images inside
representing data row states. I use the -listvariable option to manage
the text content and cellget/cellconfigure to change the icons.
Whereas the text content is updated very fast the icon updates are
very slow "somtime". After the 1st setting access is much faster,
esp. the "cellget" command is very slow on the 1st access of the
cell content.

New table twice iterated:
...
30955 microseconds per iteration cellget(215,1), tl size=220r,13c
30575 microseconds per iteration cellget(216,1), tl size=220r,13c
30623 microseconds per iteration cellget(217,1), tl size=220r,13c
30452 microseconds per iteration cellget(218,1), tl size=220r,13c
29571 microseconds per iteration cellget(219,1), tl size=220r,13c
45 microseconds per iteration cellget(0,1), tl size=220r,13c
775 microseconds per iteration cellget(1,1), tl size=220r,13c
529 microseconds per iteration cellget(2,1), tl size=220r,13c
520 microseconds per iteration cellget(3,1), tl size=220r,13c
523 microseconds per iteration cellget(4,1), tl size=220r,13c
...

I call "cellget" to get the current image and if is is the wrong one I
do a "cellconfigure" to set the new one.
If I ommit the "cellget" call (just setting the new one) the
"cellconfigure" behaves identical.

...
34454 microseconds per iteration cellconfigure 217,1 -image image4, tl
size=220r,13c
34295 microseconds per iteration cellconfigure 218,1 -image image4, tl
size=220r,13c
33420 microseconds per iteration cellconfigure 219,1 -image image4, tl
size=220r,13c
327 microseconds per iteration cellconfigure 0,1 -image image4, tl
size=220r,13c
941 microseconds per iteration cellconfigure 1,1 -image image4, tl
size=220r,13c
765 microseconds per iteration cellconfigure 2,1 -image image4, tl
size=220r,13c
...

My problem is, that I could not reproduce it with a simple example
because I don't know the definitive reason. I further see that the
timing values depend strongly on the size table structure.
I use massive "lset" commands because the table is updated in the
listvariable directly and several large arrays containig the table
value content are used too.
If I increase the number of records (the listvariable is created new)
again the 1st 220 entries (i. e. the old size, which already have configurend
images!) are accessed very slow.

...
352386 microseconds per iteration cellget(216,1), tl size=2648r,13c
355514 microseconds per iteration cellget(217,1), tl size=2648r,13c
351132 microseconds per iteration cellget(218,1), tl size=2648r,13c
353706 microseconds per iteration cellget(219,1), tl size=2648r,13c
351191 microseconds per iteration cellget(220,1), tl size=2648r,13c
7382 microseconds per iteration cellget(221,1), tl size=2648r,13c
7765 microseconds per iteration cellget(222,1), tl size=2648r,13c
7430 microseconds per iteration cellget(223,1), tl size=2648r,13c
9313 microseconds per iteration cellget(224,1), tl size=2648r,13c
...

Any idea what the reason could be? Where to dig further?
Any idea how this could be circumvented?

--
Gerhard Reithofer - Techn. EDV Reithofer - http://www.tech-edv.co.at

nemethi

unread,
Apr 5, 2017, 11:49:17 AM4/5/17
to
The cellcget subcommand just returns the value of an entry within an
internal array. Before doing this, however, just like most other
subcommands, it checks whether there are any changes in the
listvariable, and updates the widget if needed.

When using a listvariable, it is an important rule to keep the frequency
of such synchronizations as low as possible, as explained in Remark 1
within the description of the -listvariable option in the reference
manual. Have you checked that your script doesn't break this rule?
Unfortunately, I don't know whether your problem could be related to
this, but it might be worth examining your code under this aspect.

--
Csaba Nemethi http://www.nemethi.de mailto:csaba....@t-online.de

Gerhard Reithofer

unread,
Apr 5, 2017, 2:08:05 PM4/5/17
to
Hi Nemethi,

On Wed, 5 Apr 2017, nemethi wrote:

> Am 02.04.2017 um 16:27 schrieb Gerhard Reithofer:
> > Hi TCLers,
> > I'm working on a tool which uses tablellist and various images inside

...

> > Any idea what the reason could be? Where to dig further?
> > Any idea how this could be circumvented?
> >
>
> The cellcget subcommand just returns the value of an entry within an internal
> array. Before doing this, however, just like most other subcommands, it
> checks whether there are any changes in the listvariable, and updates the
> widget if needed.

I took a short look at the code and found many "synchronize" calls.

> When using a listvariable, it is an important rule to keep the frequency of
> such synchronizations as low as possible, as explained in Remark 1 within the
> description of the -listvariable option in the reference manual. Have you
> checked that your script doesn't break this rule? Unfortunately, I don't know
> whether your problem could be related to this, but it might be worth examining
> your code under this aspect.

Thank you for the hint about your remarks because my internal
documentation is still from 4.2, I will update this.

I also suspected this because I definitely flouted this rule in my code.
I rewrote it to not use listvariables in this specific case and until
now I did not recognize any similar behavior.

Thank you very much,
Gerhard
0 new messages