modelx.start_stacktrace#

start_stacktrace(maxlen=10000)[source]#

Activate stack tracing.

Start tracing the call stack of formula calculations held internally in modelx.

The tracing is useful when the user wants to get the information on the execution of cells formulas, such as how much time each formula takes from start to finish, or what formulas are called in what order to identify performance bottlenecks.

While the tracing is active, the history of loading and unloading cells and its arguments to/from the call stack is recorded with timestamps and available through calling get_stacktrace() function. The tracing continues until the user calls stop_stacktrace().

Warning

Activating stack tracing may slow down formula calculations. You should activate it only when needed for inspection purposes.

Parameters:

maxlen (int, optional) – Max number of records to be kept. When exceeding, records are removed from the oldest. Defaults to 10000.

Changed in version 0.1.0: maxlen parameter is added.

New in version 0.0.25.