On Wednesday, December 18, 2019 at 12:33:31 PM UTC-8, blacksqr wrote:
> It runs like lightning on Ubuntu Linux, but the UI is noticeably sluggish on Windows 10.
I also found that the console can be quite slow on
Androwish, where I've used the below hack. Note this
is modifying console code that may not work in
later versions of tcl/tk. I've tested up to 8.6.9.
The console is my primary debugging tool, and so I've
also used several tricks described here,
https://wiki.tcl-lang.org/page/console
Below, I also increase the number of lines in the
console window. And one command I add to the console is
to pause and unpause scrolling, which can also
help performance. That's what the do_scroll variable is
all about. Left at 1, as below, and it doesn't do anything.
Obviously, this hack may be a problem with other code
since this is running an [after] event which keeps
repeating every 200 ms.
This also can speed up the console on windows. It works
by not doing the [.console see insert] on every puts.
#------------------------------
console eval {
set ::tk::console::maxLines 5000 ;# normally only 600
set ::tk::console_flag 0
set ::tk::do_scroll 1
proc ::tk::console_hack {} {
if {$::tk::console_flag && $::tk::do_scroll} {
.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
}