Check-in [cecc0dd69e]

Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Edited tip/530.md
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: cecc0dd69ea36971e44585dac628065e7c9f98baad82776c36ff3b6b24b5a8b6
User & Date: leon 2018-12-14 19:08:50.258
Context
2018-12-17
04:36
Merged a fork check-in: 4f351811b4 user: leon tags: trunk
2018-12-14
19:08
Edited tip/530.md check-in: cecc0dd69e user: leon tags: trunk
2018-12-13
13:37
New TIP 530 check-in: 99daffc5b5 user: leon tags: trunk
Changes
Side-by-Side Diff Ignore Whitespace Patch
Changes to tip/530.md.
13
14
15
16
17
18
19
20
21
22



23
24
25
26
27









28
29
30
31



32
33
34
35
36
37
38
13
14
15
16
17
18
19



20
21
22
23




24
25
26
27
28
29
30
31
32
33



34
35
36
37
38
39
40
41
42
43







-
-
-
+
+
+

-
-
-
-
+
+
+
+
+
+
+
+
+

-
-
-
+
+
+








A compile-time macro and an environment variable are introduced which enable a
user of Tcl to trade some functionality brought by [[280]](280.md) for better
performance.

# Background and Motivation

[[280]](280.md) extended Tcl's abilities for introspection with the **info frame**
command able to determine the location of its call, i.e., the name of the file
the code is in, and the absolute line number in that file.
[[280]](280.md) extended Tcl's abilities for introspection with the
**info frame** command able to determine the location of its call, i.e.,
the name of the file the code is in, and the absolute line number in that file.

Though that functionality is very useful while debugging Tcl scripts it hardly
has any other use, while at the same, due to the peculiarity of its
implementation, negatively impacting the performance of Tcl code. The issue has
first been discussed at [comp.lang.tcl](https://groups.google.com/forum/#!topic/comp.lang.tcl/Qd0Q11CxjgQ).
Though that functionality was very useful while debugging Tcl scripts it hardly
had any other use, while at the same time negatively impacting the performance
of Tcl code. [[378]](378.md) has already addressed the most critical degradation
of performance caused by [[280]](280.md), however a milder slowdown has remained.
The mere fact that line continuations are tracked unconditionally and such
information, if present, is associated with a respective Tcl object through
an external hash map results in a relatively expensive check performed in
TclFreeObj() for every single object. The issue has first been discussed at
[comp.lang.tcl](https://groups.google.com/forum/#!topic/comp.lang.tcl/Qd0Q11CxjgQ).

This TIP now proposes to put the execution of some part of [[280]](280.md)'s
implementation under user control, allowing them to trade **info
frame**-exactness for speed, and vice versa.
This TIP now proposes to put the execution of the respective part of
[[280]](280.md)'s implementation under user control, allowing them to trade
**info frame**-exactness for speed, and vice versa.

# Run-time control

The environment variable `TCL_INFO_FRAME_ENABLE_ACCURATE_LINE_NUMBERS` is
checked during the startup of the main Tcl interpreter and handling of line
continuations is fixed till the end of execution as follows: