Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  nodelist  faq  login

A language that doesn't affect the way you think about programming is not worth knowing.


programming / comp.lang.tcl / Re: Text amount

SubjectAuthor
* Text amountsaitology9
+* Re: Text amountRobert Heller
|+* Re: Text amountRich
||`* Re: Text amountsaitology9
|| `* Re: Text amountRich
||  `- Re: Text amountsaitology9
|`- Re: Text amountsaitology9
`* Re: Text amountChristian Gollwitzer
 `* Re: Text amountsaitology9
  `* Re: Text amountjtyler
   `* Re: Text amountsaitology9
    `- Re: Text amountjtyler

1
Subject: Text amount
From: saitolo...@gmail.com
Newsgroups: comp.lang.tcl
Organization: Aioe.org NNTP Server
Date: Wed, 20 Apr 2022 15:07 UTC
Path: i2pn2.org!i2pn.org!aioe.org!a5rWVvs5S5ZXUwkNcVnRMw.user.46.165.242.91.POSTED!not-for-mail
From: saitolo...@gmail.com
Newsgroups: comp.lang.tcl
Subject: Text amount
Date: Wed, 20 Apr 2022 11:07:35 -0400
Organization: Aioe.org NNTP Server
Message-ID: <t3p7jr$sn$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="919"; posting-host="a5rWVvs5S5ZXUwkNcVnRMw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.6.1
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
View all headers
Hello,

I have noticed a strange behavior by tcl/tk shells that I would like to avoid.  This happens with tclsh, wish, and tkcon.  I say shell but it may just be the text widget behind the scenes causing this:

Whenever the shell needs to display back a slightly large amount of text, it locks up.  I am not talking about 10's of megabytes of text either.  Just a few kilobytes maybe.  The larger the text, the longer the wait.  Sometimes, you just end up terminating the whole session because the wait is so long.

Does anyone have a solution for this?


Subject: Re: Text amount
From: Robert Heller
Newsgroups: comp.lang.tcl
Organization: Deepwoods Software
Date: Wed, 20 Apr 2022 15:43 UTC
References: 1
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Wed, 20 Apr 2022 10:43:14 -0500
MIME-Version: 1.0
From: hel...@deepsoft.com (Robert Heller)
Organization: Deepwoods Software
X-Newsreader: TkNews 3.0 (1.2.12)
Subject: Re: Text amount
In-Reply-To: <t3p7jr$sn$1@gioia.aioe.org>
References: <t3p7jr$sn$1@gioia.aioe.org>
Newsgroups: comp.lang.tcl
Content-Type: text/plain;
charset="us-ascii"
Originator: heller@sharky4.deepsoft.com
Message-ID: <Gtidnff1sLWPt_3_nZ2dnUU7-UXNnZ2d@giganews.com>
Date: Wed, 20 Apr 2022 10:43:14 -0500
Lines: 30
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-BNugurdGjg6oSvm8e8z1yljPko9voAOXeixEE5KgbRAAbvPfU6Fnc5RUlh3U8+oBEywT6zfzaarbuX+!ZrlOP3DQnWvVPDVzUKCmIxpiYmhjIYb5KaCPaa/P+Ar2NsntiPGA/G9nBtBi9qsq265oXu7iSXMB!0XU=
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 2356
View all headers
I've never noticed this (at least not on Linux).

Is there anything special about the text?  Hugely long lines?  Strange
character sets?  How are you inserting this text?

At Wed, 20 Apr 2022 11:07:35 -0400 saitology9@gmail.com wrote:


Hello,

I have noticed a strange behavior by tcl/tk shells that I would like to
avoid.  This happens with tclsh, wish, and tkcon.  I say shell but it
may just be the text widget behind the scenes causing this:

Whenever the shell needs to display back a slightly large amount of
text, it locks up.  I am not talking about 10's of megabytes of text
either.  Just a few kilobytes maybe.  The larger the text, the longer
the wait.  Sometimes, you just end up terminating the whole session
because the wait is so long.

Does anyone have a solution for this?
                         


--
Robert Heller             -- Cell: 413-658-7953 GV: 978-633-5364
Deepwoods Software        -- Custom Software Services
http://www.deepsoft.com/ -- Linux Administration Services
heller@deepsoft.com       -- Webhosting Services
                                                                                                                            


Subject: Re: Text amount
From: Rich
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Wed, 20 Apr 2022 16:13 UTC
References: 1 2
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ric...@example.invalid (Rich)
Newsgroups: comp.lang.tcl
Subject: Re: Text amount
Date: Wed, 20 Apr 2022 16:13:41 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 39
Message-ID: <t3pbfl$fo2$1@dont-email.me>
References: <t3p7jr$sn$1@gioia.aioe.org> <Gtidnff1sLWPt_3_nZ2dnUU7-UXNnZ2d@giganews.com>
Injection-Date: Wed, 20 Apr 2022 16:13:41 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="857342e16256d42e82f106c3c32edc98";
logging-data="16130"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18gZ3L8D1OXk/X+ykn8vibv"
User-Agent: tin/2.0.1-20111224 ("Achenvoir") (UNIX) (Linux/3.10.17 (x86_64))
Cancel-Lock: sha1:RFA1U+RyLCH8vUeVfs7MRNa1qTY=
View all headers
Robert Heller <heller@deepsoft.com> wrote:

At Wed, 20 Apr 2022 11:07:35 -0400 saitology9@gmail.com wrote:


Hello,

I have noticed a strange behavior by tcl/tk shells that I would like
to avoid.  This happens with tclsh, wish, and tkcon.  I say shell
but it may just be the text widget behind the scenes causing this:

Whenever the shell needs to display back a slightly large amount of
text, it locks up.  I am not talking about 10's of megabytes of text
either.  Just a few kilobytes maybe.  The larger the text, the
longer the wait.  Sometimes, you just end up terminating the whole
session because the wait is so long.

Does anyone have a solution for this?

I've never noticed this (at least not on Linux).


I've seen it on windows machines with the default wish console, but
not with "a few kilobytes", the text had to be quite large (i.e.,
significantly larger than "a few kilobytes", bordering on megabytes or
so).

Two (maybe) solutions to the OP:

1) when running commands that would return a lot of text -- but you do
not really need the text printed, append a "; list" to the end before
executing the command.  The text that would return will not show
(because what you'll see is the return from 'list', which is an empty
list.

2) try TkCon https://wiki.tcl-lang.org/page/Tkcon). It might cope
better, but it might not, as it uses the text widget behind the scenes
as well.



Subject: Re: Text amount
From: saitolo...@gmail.com
Newsgroups: comp.lang.tcl
Organization: Aioe.org NNTP Server
Date: Wed, 20 Apr 2022 17:23 UTC
References: 1 2
Path: i2pn2.org!i2pn.org!aioe.org!a5rWVvs5S5ZXUwkNcVnRMw.user.46.165.242.91.POSTED!not-for-mail
From: saitolo...@gmail.com
Newsgroups: comp.lang.tcl
Subject: Re: Text amount
Date: Wed, 20 Apr 2022 13:23:03 -0400
Organization: Aioe.org NNTP Server
Message-ID: <t3pfhn$c7$1@gioia.aioe.org>
References: <t3p7jr$sn$1@gioia.aioe.org>
<Gtidnff1sLWPt_3_nZ2dnUU7-UXNnZ2d@giganews.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="391"; posting-host="a5rWVvs5S5ZXUwkNcVnRMw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.6.1
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
View all headers
On 4/20/22 11:43 AM, Robert Heller wrote:
I've never noticed this (at least not on Linux).

Is there anything special about the text?  Hugely long lines?  Strange
character sets?  How are you inserting this text?


Hello,

Inserting the text is not a problem but displaying it back is.  Or when you enter something and want to edit it inline using up-arrow key.

Most of the time it is an array and I use "parray" to print it. Some of the data consists of canvas coordinates.


Subject: Re: Text amount
From: saitolo...@gmail.com
Newsgroups: comp.lang.tcl
Organization: Aioe.org NNTP Server
Date: Wed, 20 Apr 2022 17:29 UTC
References: 1 2 3
Path: i2pn2.org!i2pn.org!aioe.org!a5rWVvs5S5ZXUwkNcVnRMw.user.46.165.242.91.POSTED!not-for-mail
From: saitolo...@gmail.com
Newsgroups: comp.lang.tcl
Subject: Re: Text amount
Date: Wed, 20 Apr 2022 13:29:09 -0400
Organization: Aioe.org NNTP Server
Message-ID: <t3pft5$8a8$1@gioia.aioe.org>
References: <t3p7jr$sn$1@gioia.aioe.org>
<Gtidnff1sLWPt_3_nZ2dnUU7-UXNnZ2d@giganews.com> <t3pbfl$fo2$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="8520"; posting-host="a5rWVvs5S5ZXUwkNcVnRMw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.6.1
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
View all headers
On 4/20/22 12:13 PM, Rich wrote:

I've seen it on windows machines with the default wish console, but
not with "a few kilobytes", the text had to be quite large (i.e.,
significantly larger than "a few kilobytes", bordering on megabytes or
so).


Hello,

Yes, this is on a Windows machine too. I checked the actual size of the data and you are right: it is over 100-200 Kbyte raange.  The data is in an array and while the array itself is small in terms of entries, some of its data consists of coordinates of canvas line segments, which to my surprise were quite long.


Two (maybe) solutions to the OP:

1) when running commands that would return a lot of text -- but you do
not really need the text printed, append a "; list" to the end before
executing the command.  The text that would return will not show
(because what you'll see is the return from 'list', which is an empty
list.


This is a good trick.  I use "; set x" where x does not exist.  But list is a nicer solution.


2) try TkCon https://wiki.tcl-lang.org/page/Tkcon). It might cope
better, but it might not, as it uses the text widget behind the scenes
as well.


I see it with wish and tkcon, but not tclsh. I suspect it has to do with coloring for some reason.



Subject: Re: Text amount
From: Rich
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Wed, 20 Apr 2022 18:22 UTC
References: 1 2 3 4
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ric...@example.invalid (Rich)
Newsgroups: comp.lang.tcl
Subject: Re: Text amount
Date: Wed, 20 Apr 2022 18:22:15 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 52
Message-ID: <t3pj0n$eks$1@dont-email.me>
References: <t3p7jr$sn$1@gioia.aioe.org> <Gtidnff1sLWPt_3_nZ2dnUU7-UXNnZ2d@giganews.com> <t3pbfl$fo2$1@dont-email.me> <t3pft5$8a8$1@gioia.aioe.org>
Injection-Date: Wed, 20 Apr 2022 18:22:15 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="857342e16256d42e82f106c3c32edc98";
logging-data="15004"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/1bWRGfP2c/2aNWmQXqkpM"
User-Agent: tin/2.0.1-20111224 ("Achenvoir") (UNIX) (Linux/3.10.17 (x86_64))
Cancel-Lock: sha1:eQ3yvxrowBGznHP2BU9KdcschHQ=
View all headers
saitology9@gmail.com wrote:
On 4/20/22 12:13 PM, Rich wrote:

I've seen it on windows machines with the default wish console, but
not with "a few kilobytes", the text had to be quite large (i.e.,
significantly larger than "a few kilobytes", bordering on megabytes or
so).


Hello,

Yes, this is on a Windows machine too. I checked the actual size of the
data and you are right: it is over 100-200 Kbyte raange.  The data is in
an array and while the array itself is small in terms of entries, some
of its data consists of coordinates of canvas line segments, which to my
surprise were quite long.

The console configures its text widget to perform line wrap.  Part of
the slowness may be the work necessary to decide the line wrap points
for very long lines.  And your "canvas line segments" may very well be
"very long lines".

Two (maybe) solutions to the OP:

1) when running commands that would return a lot of text -- but you do
not really need the text printed, append a "; list" to the end before
executing the command.  The text that would return will not show
(because what you'll see is the return from 'list', which is an empty
list.

This is a good trick.  I use "; set x" where x does not exist.  But list
is a nicer solution.

Plain 'list' avoids having to see "can't read "x": no such variable"
errors all the time.

2) try TkCon https://wiki.tcl-lang.org/page/Tkcon). It might cope
better, but it might not, as it uses the text widget behind the scenes
as well.


I see it with wish and tkcon, but not tclsh. I suspect it has to do with
coloring for some reason.

Because windows has no 'console' (in the Unix/Linux sense) wish has to
simulate one.  The wish console is that simulation.

With tclsh, the 'console' it uses is the windows cmd shell window (or
power shell window) that it runs within, so it does not need to
"provide a console".  It just pushes data out the stdout file channel
and is done.  The cmd shell or power shell window handles the display
of that data.


Subject: Re: Text amount
From: Christian Gollwitzer
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Wed, 20 Apr 2022 18:27 UTC
References: 1
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: aurio...@gmx.de (Christian Gollwitzer)
Newsgroups: comp.lang.tcl
Subject: Re: Text amount
Date: Wed, 20 Apr 2022 20:27:22 +0200
Organization: A noiseless patient Spider
Lines: 34
Message-ID: <t3pjab$m23$1@dont-email.me>
References: <t3p7jr$sn$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 20 Apr 2022 18:27:23 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="da30b9341704796417b75448364a9643";
logging-data="22595"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/mgQrT4eJzfvelK87bCrbXhcLB3NJrKFQ="
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:91.0)
Gecko/20100101 Thunderbird/91.8.0
Cancel-Lock: sha1:yXTyu+MfDvMo7VRuaRyxMINKfgg=
In-Reply-To: <t3p7jr$sn$1@gioia.aioe.org>
View all headers
Am 20.04.22 um 17:07 schrieb saitology9@gmail.com:
Hello,

I have noticed a strange behavior by tcl/tk shells that I would like to avoid.  This happens with tclsh, wish, and tkcon.  I say shell but it may just be the text widget behind the scenes causing this:

Whenever the shell needs to display back a slightly large amount of text, it locks up.  I am not talking about 10's of megabytes of text either.  Just a few kilobytes maybe.

This is a known issue with the current text widget, it scales very badly with the length of the lines. When you have a lot of text and the line length is limited, like e.g.

string repeat "a\n" 10000

there is no problem - 10,000 lines with just one char display fine. When you have a single long line like


string repeat "a " 10000

the display takes ages, and also scrolling (each redisplay) is unbearably slow due to high CPU load for each display. There is currently an alternative implementation of the text widget under development, which does not have this problem - see here:

https://core.tcl-lang.org/tips/doc/trunk/tip/466.md

Unfortunately, that will become reality only in Tk 8.7+, and due to limited capacity of the core team, the release cycle is also slow.

Christian


Subject: Re: Text amount
From: saitolo...@gmail.com
Newsgroups: comp.lang.tcl
Organization: Aioe.org NNTP Server
Date: Wed, 20 Apr 2022 19:43 UTC
References: 1 2 3 4 5
Path: i2pn2.org!i2pn.org!aioe.org!a5rWVvs5S5ZXUwkNcVnRMw.user.46.165.242.91.POSTED!not-for-mail
From: saitolo...@gmail.com
Newsgroups: comp.lang.tcl
Subject: Re: Text amount
Date: Wed, 20 Apr 2022 15:43:21 -0400
Organization: Aioe.org NNTP Server
Message-ID: <t3pnoq$259$1@gioia.aioe.org>
References: <t3p7jr$sn$1@gioia.aioe.org>
<Gtidnff1sLWPt_3_nZ2dnUU7-UXNnZ2d@giganews.com> <t3pbfl$fo2$1@dont-email.me>
<t3pft5$8a8$1@gioia.aioe.org> <t3pj0n$eks$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="2217"; posting-host="a5rWVvs5S5ZXUwkNcVnRMw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.6.1
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
View all headers
On 4/20/22 2:22 PM, Rich wrote:

With tclsh, the 'console' it uses is the windows cmd shell window (or
power shell window) that it runs within, so it does not need to
"provide a console".  It just pushes data out the stdout file channel
and is done.  The cmd shell or power shell window handles the display
of that data.


Ah, that makes sense. Thank you; good info.


Subject: Re: Text amount
From: saitolo...@gmail.com
Newsgroups: comp.lang.tcl
Organization: Aioe.org NNTP Server
Date: Wed, 20 Apr 2022 19:45 UTC
References: 1 2
Path: i2pn2.org!i2pn.org!aioe.org!a5rWVvs5S5ZXUwkNcVnRMw.user.46.165.242.91.POSTED!not-for-mail
From: saitolo...@gmail.com
Newsgroups: comp.lang.tcl
Subject: Re: Text amount
Date: Wed, 20 Apr 2022 15:45:41 -0400
Organization: Aioe.org NNTP Server
Message-ID: <t3pnt6$259$2@gioia.aioe.org>
References: <t3p7jr$sn$1@gioia.aioe.org> <t3pjab$m23$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="2217"; posting-host="a5rWVvs5S5ZXUwkNcVnRMw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.6.1
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
View all headers
On 4/20/22 2:27 PM, Christian Gollwitzer wrote:

This is a known issue with the current text widget, it scales very badly with the length of the lines. When you have a lot of text and the line length is limited, like e.g.


Hello,

Thank you! I suppose as long as it is fixed and is scheduled for release, that is OK.



Subject: Re: Text amount
From: jtyler
Newsgroups: comp.lang.tcl
Organization: Aioe.org NNTP Server
Date: Thu, 21 Apr 2022 00:14 UTC
References: 1 2 3
Path: i2pn2.org!i2pn.org!aioe.org!YN2ulY6LKp1eoOUw2OJ8ig.user.46.165.242.91.POSTED!not-for-mail
From: jtyler...@gmail.com (jtyler)
Newsgroups: comp.lang.tcl
Subject: Re: Text amount
Date: Wed, 20 Apr 2022 17:14:52 -0700
Organization: Aioe.org NNTP Server
Message-ID: <t3q7lt$1vdv$1@gioia.aioe.org>
References: <t3p7jr$sn$1@gioia.aioe.org> <t3pjab$m23$1@dont-email.me>
<t3pnt6$259$2@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="64959"; posting-host="YN2ulY6LKp1eoOUw2OJ8ig.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.7.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
View all headers
On 4/20/2022 12:45 PM, saitology9@gmail.com wrote:
On 4/20/22 2:27 PM, Christian Gollwitzer wrote:

This is a known issue with the current text widget, it scales very badly with the length of the lines. When you have a lot of text and the line length is limited, like e.g.


Hello,

Thank you! I suppose as long as it is fixed and is scheduled for release, that is OK.


If you are just using the windows console for debugging, and don't mind using a little hack, try typing the following:


% string repeat abcdef 10000

This will take over 10 seconds on my computer.
Then clear the console and paste this in:

  console eval {

     set ::tk::console_flag 0

     proc ::tk::console_hack {} {

         if {$::tk::console_flag } {
             .console mark set insert end
             .console see insert
             set ::tk::console_flag 0
         }
         after 200   ::tk::console_hack
     }
     proc ::tk::ConsoleOutput {dest string} {
         set w .console
         $w insert output $string $dest
         ::tk::console::ConstrainBuffer $w $::tk::console::maxLines
         set ::tk::console_flag 1
     }
     after 200   ::tk::console_hack

  }



Then run the string repeat again, and for me, it then takes under 1 second. But scrolling is still very slow, so clear the console afterwards.

The problem it addresses is the code normally does a

..console see insert

for every line output through the :tk::ConsoleOutput code. This hack will cause it to do that at most 5 times a second.



If you really want to play with the console, you can check out the wiki page

https://wiki.tcl-lang.org/page/console

I have added several buttons and menu commands to the standard console since it is my primary debugging device.

On Androwish, the console was really slow, and so I use the above hack in all my programs that output anything to the console.






Subject: Re: Text amount
From: saitolo...@gmail.com
Newsgroups: comp.lang.tcl
Organization: Aioe.org NNTP Server
Date: Thu, 21 Apr 2022 01:50 UTC
References: 1 2 3 4
Path: i2pn2.org!i2pn.org!aioe.org!a5rWVvs5S5ZXUwkNcVnRMw.user.46.165.242.91.POSTED!not-for-mail
From: saitolo...@gmail.com
Newsgroups: comp.lang.tcl
Subject: Re: Text amount
Date: Wed, 20 Apr 2022 21:50:15 -0400
Organization: Aioe.org NNTP Server
Message-ID: <t3qd8o$1gjg$1@gioia.aioe.org>
References: <t3p7jr$sn$1@gioia.aioe.org> <t3pjab$m23$1@dont-email.me>
<t3pnt6$259$2@gioia.aioe.org> <t3q7lt$1vdv$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="49776"; posting-host="a5rWVvs5S5ZXUwkNcVnRMw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.6.1
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
View all headers
On 4/20/22 8:14 PM, jtyler wrote:

The problem it addresses is the code normally does a

.console see insert

for every line output through the :tk::ConsoleOutput code. This hack will cause it to do that at most 5 times a second.



Hello,

Interesting - it works from the wish console.  The same amount of output that locks up normal wish console is now instantaneous.  However, there seems to be a side effect: it seems to slow down everything.  Opening my application window, I can see widgets appearing one by one (i.e., very slowly).  Even dragging the console window by its title bar (from MS Windows) is slow and jumpy.  Ideally it could have a way to turn it on and off depending on the amount of text.

In any case, as annoying as it could be at times, the original issue is no big deal really.






Subject: Re: Text amount
From: jtyler
Newsgroups: comp.lang.tcl
Organization: Aioe.org NNTP Server
Date: Thu, 21 Apr 2022 02:13 UTC
References: 1 2 3 4 5
Path: i2pn2.org!i2pn.org!aioe.org!YN2ulY6LKp1eoOUw2OJ8ig.user.46.165.242.91.POSTED!not-for-mail
From: jtyler...@gmail.com (jtyler)
Newsgroups: comp.lang.tcl
Subject: Re: Text amount
Date: Wed, 20 Apr 2022 19:13:47 -0700
Organization: Aioe.org NNTP Server
Message-ID: <t3qeks$1s4e$1@gioia.aioe.org>
References: <t3p7jr$sn$1@gioia.aioe.org> <t3pjab$m23$1@dont-email.me>
<t3pnt6$259$2@gioia.aioe.org> <t3q7lt$1vdv$1@gioia.aioe.org>
<t3qd8o$1gjg$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="61582"; posting-host="YN2ulY6LKp1eoOUw2OJ8ig.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.7.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
View all headers
On 4/20/2022 6:50 PM, saitology9@gmail.com wrote:
On 4/20/22 8:14 PM, jtyler wrote:

The problem it addresses is the code normally does a

.console see insert

for every line output through the :tk::ConsoleOutput code. This hack will cause it to do that at most 5 times a second.



Hello,

Interesting - it works from the wish console.  The same amount of output that locks up normal wish console is now instantaneous.  However, there seems to be a side effect: it seems to slow down everything.  Opening my application window, I can see widgets appearing one by one (i.e., very slowly).  Even dragging the console window by its title bar (from MS Windows) is slow and jumpy.  Ideally it could have a way to turn it on and off depending on the amount of text.

In any case, as annoying as it could be at times, the original issue is no big deal really.





Are you outputting a *whole lot of stuff* to the console? The code kinda turns itself off if there's no output. The variable ::tk::console_flag is only set to 1 if there is output thru ::tk::ConsoleOutput. If there's no output, then all it would do is wake up every 200 ms check the flag and schedule the next time in 200 ms.

If it's slowing you down, are you seeing a ton of output to the console? Otherwise, I'm stumped.

There's one other item you could add:

console eval {
     set ::tk::console::maxLines 500
}

which would limit the size of the console text to 500 chars, to see if that makes a difference. Normally, I bump this up since I don't want to lose anything.

Another surprising thing is that it helps to do something like,

puts "......" ; update

It keeps things moving through. I use it when I want to see everything coming out fast like an old time terminal, rather than in chunks.

And if you don't need 5000 char lines coming out, you can use [string range] to limit your output to a shorter line length. As mentioned by others, it's the really long lines that are the slowest.







1
rocksolid light 0.7.2
clearneti2ptor