Profiler.html 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <html>
  2. <head>
  3. <title>
  4. The Integrated Development Environment
  5. </title>
  6. </head>
  7. <body bgcolor="#FFFFFF" vlink="silver" alink="navy" link="navy">
  8. <table width="100%" border="0" cellpadding="0" cellspacing="0" summary="">
  9. <tr>
  10. <td valign="bottom">
  11. <div align="left">
  12. <b><font face="Tahoma" size="3" color="navy">The Profiler Window</font></b>
  13. <br>
  14. <font face="Tahoma" size="2">
  15. <a href="TopicGroup_TIDE.html">Topic Groups</a>
  16. </font>
  17. </div>
  18. </td>
  19. <td>
  20. <font face="Tahoma" size="1" color="silver">
  21. <div align="right" valign="top">
  22. <a href="http://www.lua.org">Lua homepage</a>
  23. </div>
  24. </font>
  25. </td>
  26. </tr>
  27. <tr valign="top">
  28. <td colspan="2">
  29. <hr size="1" color="#000000" align="top">
  30. <br>
  31. <br>
  32. <font face="Tahoma" size="2">
  33. <p style="text-align: justify">
  34. The "Profiler" window is a tool that can be use to measure, in time, the performances of your scripts. It can
  35. also be very useful to find out where exactly you should improve syntax logic to gain performances. The
  36. precision of this profiler goes down to microseconds (millionth of a second = 0.000001s = 10<sup>-6</sup>s).
  37. The profiler also provides useful information such as the Lua's VM memory at the moment of the call, the line
  38. and file path and name related to the call, overall duration usage, the nature of the call, etc.<br>
  39. <br>
  40. <b>The Main call</b><br>
  41. The profiler will never display informations in runtime to provide the most accurate data as possible. The information
  42. will instead be displayed as soon as the script is stopped. (due to error, user or normally) It will always have
  43. a [MAIN] call. That call is the script's entry call and will always have a 100% overall usage since it's the call that
  44. starts and end the script. Use the [MAIN] call to have an idea of the complete run duration of your script.<br>
  45. <br>
  46. <b>Interpreting Your Results</b><br>
  47. The profiler, as mentioned, can be a very powerful and useful tool to pinpoint your scripts' weaknesses or
  48. poor performances. To do so, LuaEdit provide a multitude of information for each call made in your script.
  49. Here is the complete list of those information:
  50. <ul type="square">
  51. <li>Function Name: The name of the function that was called.</li>
  52. <li>Line: The line number where the call was made.</li>
  53. <li>Source: The nature of the call. (either 'C' or 'Lua' depending of where the function was declared)</li>
  54. <li>Relative Usage: Percentage representating the time usage of the call relative to the previous call.</li>
  55. <li>Overall Usage: Percentage representating the time usage according to the [MAIN] call.</li>
  56. <li>Duration: Total call duration time in seconds.</li>
  57. <li>Enter Time: The most accurate time possible when the call was made.</li>
  58. <li>Exit Time: The most accurate time possible when the call returned.</li>
  59. <li>Lua Memory: The amount of memory used by Lua's virtual machine at the moment of the call.</li>
  60. </ul>
  61. <b>Tip<sup>1</sup>:</b> A very large large amount of memory used by Lua's virtual machine can be the source of poor performances.<br>
  62. <b>Tip<sup>2</sup>:</b> Put your attention and sweath toward functions that are taking most of your overall processing time. Sometimes,
  63. simply reorganizing the code can improve the performances.<br>
  64. <br>
  65. <b>Residual Processes</b><br>
  66. When a script is running, a large amount of processing time is spent to code logic itself. That is, all if
  67. statements, for and while loops, variable declaration and accessing, etc. This time is spent somewhere and
  68. is displayed as [RESIDUAL PROCESSES].<br>
  69. <br>
  70. <b>Note<sup>1</sup>:</b> Be aware that if LuaEdit hits a breakpoint, this will "falsify" the results. To get "true"
  71. performances values, you should always run the script from begining to end without hitting a breakpoint.<br>
  72. <br>
  73. <b>Note<sup>2</sup>:</b> If all the results from the profiler are equal to zero (0), it might means that your hardware setup does not
  74. support high performances counter and high performances frequencies.
  75. <br>
  76. <br>
  77. <br>
  78. <img src="..\..\Medias\Profiler.jpg" alt="The Profiler Window">
  79. </p>
  80. <br>
  81. </font>
  82. </td>
  83. </tr>
  84. <tr>
  85. <td colspan="2">
  86. <font face="Tahoma" size="1" color="silver">
  87. <hr size="1" color="#000000">
  88. <div align="right">
  89. <a href="http://www.luaedit.net">www.luaedit.net</a>
  90. <br>
  91. © Copyright 2004-2007 Jean-Francois Goulet
  92. <br>
  93. LuaEdit 3.0.4 for Lua 5.1
  94. </div>
  95. </font>
  96. </td>
  97. </tr>
  98. </table>
  99. </body>
  100. </html>