[patch] Selection stats in statusbar

Daniel xracoonx at gmx.de
Thu Jul 14 07:31:06 UTC 2022


On 2022-07-14 00:13, Pavel Sanda wrote:
> On Wed, Jul 13, 2022 at 08:54:28AM +0200, Daniel wrote:
>> Hi,
>>
>> There is also a patch for instant counts at
>> https://www.lyx.org/trac/ticket/12422. It works with delayed calculations. I
>> have no idea how this does performance wise, but it might be worth checking
>> out.
> 
> Yes, that's lazy man approach, using timer instead of parallel thread.

I got the idea when I noticed that other word processors (e.g. LO 
Writer, MS Word) showed the stats delayed. So, I thought that this is 
probably (part of) a decent way to implement this.

> The advantage is that you avoid race-conditions (though I think you miss stop()
> inside closeEvent()?).

I might have missed that. It's some time ago that I wrote the code and 
don't remember from the top of my head.

> The drawback is that's it's difficult to understand the interaction between
> the two timers now. I stared on the code for couple minutes and it was
> not clear to me what is the idea behind your stop/start changes.

Some comments would probably have been good. I could try to add them if 
there is interest.

> JMarc's warning about ineeficiency of counting remain unaddressed, though
> it migh not be visible because of 300ms update sampling frequency.

Yes, I just took for granted the stats that LyX already generates. My 
patch inherits all the downsides of whatever approach is used there.

Daniel




More information about the lyx-devel mailing list