# TIP 530: Control over performance impact of TIP 280 Author: Leon Manukyan <leon.manukyan@gmail.com> State: Draft Type: Project Vote: Pending Created: 13-Dec-2018 Tcl-Version: 8.6, 8.7 Post-History: Tcl-Ticket: a09031e288-----# AbstractA compile-time macro and an environment variable are introduced which enable auser of Tcl to trade some functionality brought by [[280]](280.md) for betterperformance.# 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 filethe code is in, and the absolute line number in that file.Though that functionality is very useful while debugging Tcl scripts it hardlyhas 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)'simplementation under user control, allowing them to trade **infoframe**-exactness for speed, and vice versa.# Run-time controlThe environment variable `TCL_INFO_FRAME_ENABLE_ACCURATE_LINE_NUMBERS` ischecked during the startup of the main Tcl interpreter and handling of linecontinuations is fixed till the end of execution as follows:* If the value of that environment variable is 0, then line continuations (backslash+newline) sequences are not tracked (thus resulting in improved performance) and the line numbers returned by `info frame` may be wrong.* For any other value of that environment variable the line continuations are tracked and correct line numbers are reported by `info frame`.# Build-time controlThe default value assumed for the environment variable`TCL_INFO_FRAME_ENABLE_ACCURATE_LINE_NUMBERS` when it is unset is defined by thecompilation macro of the same name. That is a Tcl interpreter built with`-DTCL_INFO_FRAME_ENABLE_ACCURATE_LINE_NUMBERS=X` will behave by defaultas if the env var `TCL_INFO_FRAME_ENABLE_ACCURATE_LINE_NUMBERS` is set to `X`(but the actual value of that variable, if it is set, will be respected).## Default SettingUnless users don't take any deliberate action (assuming that they didn't usethe said compilation macro in their build processes or the environmentvariable in their flows) they won't notice any change in behavior.# Reference ImplementationA reference implementation is provided at<https://core.tcl.tk/tcl/artifact/3b68b7cd8131a42a> .# CopyrightThis document has been placed in the public domain.