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.
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 itsimplementation, negatively impacting the performance of Tcl code. The issue hasfirst 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.
# 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:

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.
Though that functionality was very useful while debugging Tcl scripts it hardly
had any other use, while at the same time negatively impacting the performanceof Tcl code. [[378]](378.md) has already addressed the most critical degradationof performance caused by [[280]](280.md), however a milder slowdown has remained.The mere fact that line continuations are tracked unconditionally and suchinformation, if present, is associated with a respective Tcl object throughan external hash map results in a relatively expensive check performed inTclFreeObj() 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 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: