2 This is a simple profiler to estimate processing time per module per function.
4 It seems to work okay, but there was no heavy testing so far. See test-profiler.lua for a short example.
8 This is a Boolean flag to state if the printing should be done in color. It is true by default.
10 ### profiler.decorate(model, [functionsToDecorate]) ###
12 This function should be called before starting the computation.
14 It replaces functions specified in functionsToDecorate by instrumented versions which keep track of computation times. If functionsToDecorate is not provided, it decorates by default updateOutput and backward.
16 It also resets the accumulated timings to zero.
18 ### profiler.print(model, [nbSamples], [totalTime]) ###
20 Prints the measured processing times. If nbSamples is provided, the time per samples will also be printed. If totalTime is not provided, the total at the top is used.
22 Non-Containers are hilighted with a '*' or in red.