Hi,
I just realized, that putting very large string into entry is very
slow.
My string was 35k chars long. In my code I set the entry's variable
to this string. The time needed to complete the action is the order
of magnitude of 1 second.
Alexandru <alexandr...@meshparts.de> wrote:
Hi,
I just realized, that putting very large string into entry is very
slow.
My string was 35k chars long. In my code I set the entry's variableIn addition to what Ralf indicated, is there some reason why you are inserting such large strings into entries? An entry does not support
to this string. The time needed to complete the action is the order
of magnitude of 1 second.
word wrap and attempting to actually use a display of a 35k character
string in an entry would be a UI nightmare.
An entry that contains a string longer than the width of the entry
itself begins to become a pain in the a** even if only a small part is obscured. The longer the string, the bigger the pain. With 35k
characters, almost all characters of the string will be off one edge or
the other, and invisible.
* Alexandru <alexandr...@meshparts.de>What is your OS?
| My string was 35k chars long. In my code I set the entry's variable to
| this string. The time needed to complete the action is the order of
| magnitude of 1 second.
| pack [entry .e -textvariable ::myvar]
| set s [join [lrepeat 35000 "a"] ""]
| set ::myvar $s
| Can you confirm this behavior?
No:
pack [entry .e -textvariable ::myvar]
update
set s [join [lrepeat 35000 "a"] ""]
(curious: why not simply 'string repeat'?)
time { set ::myvar $s }
4579 microseconds per iteration
Note that if you run that interactively, the printing of the result string
to the console may take some time, too.
% info patchlevel
8.6.11
% parray tcl_platform
tcl_platform(byteOrder) = littleEndian
tcl_platform(engine) = Tcl
tcl_platform(machine) = x86_64
tcl_platform(os) = Linux
tcl_platform(osVersion) = 5.3.18-59.27-default
tcl_platform(pathSeparator) = :
tcl_platform(platform) = unix
tcl_platform(pointerSize) = 8
tcl_platform(threaded) = 1
tcl_platform(user) = ralf
tcl_platform(wordSize) = 8
R'
Rich schrieb am Mittwoch, 20. Oktober 2021 um 20:13:51 UTC+2:
Alexandru <alexandr...@meshparts.de> wrote:
Hi,In addition to what Ralf indicated, is there some reason why you are
I just realized, that putting very large string into entry is very
slow.
My string was 35k chars long. In my code I set the entry's
variable to this string. The time needed to complete the action
is the order of magnitude of 1 second.
inserting such large strings into entries? An entry does not
support word wrap and attempting to actually use a display of a 35k
character string in an entry would be a UI nightmare.
An entry that contains a string longer than the width of the entry
itself begins to become a pain in the a** even if only a small part
is obscured. The longer the string, the bigger the pain. With 35k
characters, almost all characters of the string will be off one edge
or the other, and invisible.
I already taken care of that. The long string is now cut if longer
than 100 chars. But still, I can think of another situation where
this could happen. The question is still, why it's so slow? Aside
from any UI considerations.
Ralf Fassel schrieb am Mittwoch, 20. Oktober 2021 um 18:09:25 UTC+2:
* Alexandru <alexandr...@meshparts.de>What is your OS?
| My string was 35k chars long. ... In my code I set the entry's variable to >> | this string. The time needed to complete the action is the order of
| magnitude of 1 second.
| Can you confirm this behavior?
No:
pack [entry .e -textvariable ::myvar]
update
set s [join [lrepeat 35000 "a"] ""]
(curious: why not simply 'string repeat'?)
time { set ::myvar $s }
4579 microseconds per iteration
Note that if you run that interactively, the printing of the result
string to the console may take some time, too.
R'
I'm on Windows 10, 64 bit
Alexandru <alexandr...@meshparts.de> wrote:I'm opening the console in advance and call a script using "source". There is no output to the console so that is not the reson. I'm aware that the console is slow on outputing long strings.
Rich schrieb am Mittwoch, 20. Oktober 2021 um 20:13:51 UTC+2:
Alexandru <alexandr...@meshparts.de> wrote:
Hi,In addition to what Ralf indicated, is there some reason why you are
I just realized, that putting very large string into entry is very
slow.
My string was 35k chars long. In my code I set the entry's
variable to this string. The time needed to complete the action
is the order of magnitude of 1 second.
inserting such large strings into entries? An entry does not
support word wrap and attempting to actually use a display of a 35k
character string in an entry would be a UI nightmare.
An entry that contains a string longer than the width of the entry
itself begins to become a pain in the a** even if only a small part
is obscured. The longer the string, the bigger the pain. With 35k
characters, almost all characters of the string will be off one edge
or the other, and invisible.
I already taken care of that. The long string is now cut if longerSee my other response asking if you were using the Tcl console window.
than 100 chars. But still, I can think of another situation where
this could happen. The question is still, why it's so slow? Aside
from any UI considerations.
Rich schrieb am Mittwoch, 20. Oktober 2021 um 22:11:23 UTC+2:
Alexandru <alexandr...@meshparts.de> wrote:
Rich schrieb am Mittwoch, 20. Oktober 2021 um 20:13:51 UTC+2:See my other response asking if you were using the Tcl console window.
Alexandru <alexandr...@meshparts.de> wrote:
Hi,In addition to what Ralf indicated, is there some reason why you are
I just realized, that putting very large string into entry is very
slow.
My string was 35k chars long. In my code I set the entry's
variable to this string. The time needed to complete the action
is the order of magnitude of 1 second.
inserting such large strings into entries? An entry does not
support word wrap and attempting to actually use a display of a 35k
character string in an entry would be a UI nightmare.
An entry that contains a string longer than the width of the entry
itself begins to become a pain in the a** even if only a small part
is obscured. The longer the string, the bigger the pain. With 35k
characters, almost all characters of the string will be off one edge
or the other, and invisible.
I already taken care of that. The long string is now cut if longer
than 100 chars. But still, I can think of another situation where
this could happen. The question is still, why it's so slow? Aside
from any UI considerations.
I'm opening the console in advance and call a script using "source".
There is no output to the console so that is not the reson. I'm
aware that the console is slow on outputing long strings.
Alexandru <alexandr...@meshparts.de> wrote:
Rich schrieb am Mittwoch, 20. Oktober 2021 um 22:11:23 UTC+2:
Alexandru <alexandr...@meshparts.de> wrote:
Rich schrieb am Mittwoch, 20. Oktober 2021 um 20:13:51 UTC+2:See my other response asking if you were using the Tcl console window.
Alexandru <alexandr...@meshparts.de> wrote:
Hi,In addition to what Ralf indicated, is there some reason why you are
I just realized, that putting very large string into entry is very
slow.
My string was 35k chars long. In my code I set the entry's
variable to this string. The time needed to complete the action
is the order of magnitude of 1 second.
inserting such large strings into entries? An entry does not
support word wrap and attempting to actually use a display of a 35k
character string in an entry would be a UI nightmare.
An entry that contains a string longer than the width of the entry
itself begins to become a pain in the a** even if only a small part
is obscured. The longer the string, the bigger the pain. With 35k
characters, almost all characters of the string will be off one edge
or the other, and invisible.
I already taken care of that. The long string is now cut if longer
than 100 chars. But still, I can think of another situation where
this could happen. The question is still, why it's so slow? Aside
from any UI considerations.
I'm opening the console in advance and call a script using "source".The source command will return the last string output by the last
There is no output to the console so that is not the reson. I'm
aware that the console is slow on outputing long strings.
command in the file it sources. Have you shown us the exact script you sourced? Because the script you /did/ show us most definitely outputs
a 35k character long string to the console.
Am 21.10.2021 um 11:32 schrieb Ralf Fassel:
* Alexandru <alexandr...@meshparts.de>
| Ralf Fassel schrieb am Mittwoch, 20. Oktober 2021 um 18:09:25 UTC+2: --<snip-snip>--
| > tcl_platform(machine) = x86_64
| > tcl_platform(os) = Linux
| >
| > R'
| What is your OS?
| I'm on Windows 10, 64 bit
See above, Linux 64bit.
I get the same results on Windows:
% cat t.tcl
pack [entry .e -textvariable ::myvar]
set s [join [lrepeat 35000 "a"] ""]
set ::myvar $s
return
% wishpp
% time {source t.tcl}
11351 microseconds per iteration
% parray tcl_platform
tcl_platform(byteOrder) = littleEndian
tcl_platform(engine) = Tcl
tcl_platform(machine) = amd64
tcl_platform(os) = Windows NT
tcl_platform(osVersion) = 10.0
tcl_platform(pathSeparator) = ;
tcl_platform(platform) = windows
tcl_platform(pointerSize) = 8
tcl_platform(threaded) = 1
tcl_platform(user) = ralf
tcl_platform(wordSize) = 4
% info patchlevel
8.6.11
HTH
R'
Using Ralf's code above, I get 1811 microseconds on Windows8, 64-bit Tcl 8.6.10.
Paul
* Alexandru <alexandru.dadalau@meshparts.de>
| Ralf Fassel schrieb am Mittwoch, 20. Oktober 2021 um 18:09:25 UTC+2: --<snip-snip>--
| > tcl_platform(machine) = x86_64
| > tcl_platform(os) = Linux
| >
| > R'
| What is your OS?
| I'm on Windows 10, 64 bit
See above, Linux 64bit.
I get the same results on Windows:
% cat t.tcl
pack [entry .e -textvariable ::myvar]
set s [join [lrepeat 35000 "a"] ""]
set ::myvar $s
return
% wishpp
% time {source t.tcl}
11351 microseconds per iteration
% parray tcl_platform
tcl_platform(byteOrder) = littleEndian
tcl_platform(engine) = Tcl
tcl_platform(machine) = amd64
tcl_platform(os) = Windows NT
tcl_platform(osVersion) = 10.0
tcl_platform(pathSeparator) = ;
tcl_platform(platform) = windows
tcl_platform(pointerSize) = 8
tcl_platform(threaded) = 1
tcl_platform(user) = ralf
tcl_platform(wordSize) = 4
% info patchlevel
8.6.11
HTH
R'
I already taken care of that. The long string is now cut if longer than 100 chars.
But still, I can think of another situation where this could happen.
The question is still, why it's so slow? Aside from any UI considerations.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 285 |
Nodes: | 16 (2 / 14) |
Uptime: | 34:29:23 |
Calls: | 6,449 |
Calls today: | 1 |
Files: | 12,052 |
Messages: | 5,255,072 |