Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2002-03-23
05:24 • Closed ticket [458833ffff]: performance (lack thereof) plus 6 other changes artifact: 80ce29f3ac user: hobbs
2001-10-13
03:07 • Ticket [458833ffff]: 5 changes artifact: 0fe8ba0f2c user: hobbs
2001-09-05
18:45 • New ticket [458833ffff]. artifact: 49652e19e3 user: nobody

performance (lack thereof)

Closed458833ffffffffffffffffffffffffffffffffffCreated 25 years agoUpdated 25 years ago
Descriptionplain2001-09-05 18:45:07
Attached is a profile from running 8.4a3 with a Tk
entry widget
that is initialized with a few unicode characters. 
This widget
takes 3 seconds to appear; Tcl seems mired in unicode
nonsense
(3000000+ calls).  Is something wrong with this
picture??


 time   seconds   seconds    calls  us/call  us/call 
name    
  8.57      0.06     0.06   554567     0.11     0.11 
Tcl_UniCharIsUpper
  8.57      0.12     0.06   159325     0.38     0.38 
Tcl_DStringAppend
  5.71      0.16     0.04    21491     1.86     3.80 
Tcl_JoinPath
  5.71      0.20     0.04     2398    16.68    29.99 
UtfToUtfProc
  5.71      0.24     0.04      856    46.73    46.73 
TranslateInputEOL
  5.71      0.28     0.04       14  2857.14  2857.14 
Tcl_UniCharCaseMatch
  4.29      0.31     0.03  1073071     0.03     0.03 
Tcl_UniCharToUtf
  4.29      0.34     0.03     9203     3.26    13.79 
TkFontParseXLFD
  4.29      0.37     0.03      269   111.52   445.73 
LoadTableEncoding
  2.86      0.39     0.02  1662439     0.01     0.01 
Tcl_UtfToUniChar
  2.86      0.41     0.02   166772     0.12     0.22 
Tcl_StringMatch
  2.86      0.43     0.02    73675     0.27     0.27 
Tcl_DStringFree
  2.86      0.45     0.02    27518     0.73     0.73 
TkFontGetAliasList
  2.86      0.47     0.02    22422     0.89     1.06 
TableFromUtfProc
  2.86      0.49     0.02     5378     3.72     9.60 
Tcl_SplitPath

Here's the script:

entry .e -font \
-jis-fixed-medium-i-normal--16-150-75-75-c-160-jisx0208.1983-0
pack .e
.e insert insert \u00a9Hello\uc2a9\u00c2
exit

If you replace c2a9 with something with a glyph
then you get about a 2x improvement, but still
unacceptable, IMHO. 
Tcl subfonting seems to have a real problem with fonts
with
"-fixed-" in their names.
hobbsplain2001-10-13 03:07:20
Logged In: YES 
user_id=72656

Tk needs better handling of the implicit font char search, 
which is causing the above problems.
hobbsplain2002-03-23 05:24:34
Logged In: YES 
user_id=72656

The problem is really that a char was requested and the 
font provided doesn't include that char.  There are RFEs to 
improve sub-font management which address this already, but 
the speed problem cannot otherwise be surmounted except to 
say use the best font for the expected input.
Log in (anonymous is fine) to add a comment.