Adobe 27510753 Scripting Guide - Page 62
Profiling, Functions, Lines, Add Timing Info, No Profiler Data, Show Hit Count, Show Timing
UPC - 718659445294
View all Adobe 27510753 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 62 highlights
54 Using ExtendScript Tools and Features Adobe InDesign CS2 Scripting Guide Profiling The Profiling tool helps you to optimize program execution. When you turn profiling on, the JavaScript engine collects information about a program while it is running. It counts how often the program executed a line or function, or how long it took to execute a line or function. You can choose exactly which profiling data to display. Because profiling significantly slows execution time, the Profile menu offers these profiling options. Off Functions Lines Add Timing Info No Profiler Data Show Hit Count Show Timing Erase Profiler Data Save Data As Profiling turned off. This is the default. The profiler counts each function call. At the end of execution, displays the total to the left of the line number where the function header is defined. The profiler counts each time each line is executed. At the end of execution, displays the total to the left of the line number. Consumes more execution time, but delivers more detailed information. Instead of counting the functions or lines, records the time taken to execute each function or line. At the end of execution, displays the total number of microseconds spent in the function or line, to the left of the line number. This is the most time-consuming form of profiling. When selected, do not display profiler data. When selected, display hit counts. When selected, display timing data. Clear all profiling data. Save profiling data as comma-separated values in a CSV file that can be loaded into a spreadsheet program such as Excel. When execution halts (at termination, at a breakpoint, or due to a runtime error), the Toolkit displays this information in the Editor, line by line. The profiling data is color coded: l Green indicates the lowest number of hits, or the fastest execution time. l Red indicates trouble spots, such as a line that has been executed many times, or which line took the most time to execute. This example displays timing information for the program, where the fastest line took 4 microseconds to execute, and the slowest line took 29 microseconds. The timing might not be accurate down to the microsecond; it depends on the resolution and accuracy of the hardware timers built into your computer.