Profile.html 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <html lang="en">
  2. <head>
  3. <title>Profile - avram - a virtual machine code interpreter</title>
  4. <meta http-equiv="Content-Type" content="text/html">
  5. <meta name="description" content="avram - a virtual machine code interpreter">
  6. <meta name="generator" content="makeinfo 4.13">
  7. <link title="Top" rel="start" href="index.html#Top">
  8. <link rel="up" href="Metrics-and-Maintenance.html#Metrics-and-Maintenance" title="Metrics and Maintenance">
  9. <link rel="prev" href="Note.html#Note" title="Note">
  10. <link rel="next" href="Weight.html#Weight" title="Weight">
  11. <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
  12. <meta http-equiv="Content-Style-Type" content="text/css">
  13. <style type="text/css"><!--
  14. pre.display { font-family:inherit }
  15. pre.format { font-family:inherit }
  16. pre.smalldisplay { font-family:inherit; font-size:smaller }
  17. pre.smallformat { font-family:inherit; font-size:smaller }
  18. pre.smallexample { font-size:smaller }
  19. pre.smalllisp { font-size:smaller }
  20. span.sc { font-variant:small-caps }
  21. span.roman { font-family:serif; font-weight:normal; }
  22. span.sansserif { font-family:sans-serif; font-weight:normal; }
  23. --></style>
  24. </head>
  25. <body>
  26. <div class="node">
  27. <a name="Profile"></a>
  28. <p>
  29. Next:&nbsp;<a rel="next" accesskey="n" href="Weight.html#Weight">Weight</a>,
  30. Previous:&nbsp;<a rel="previous" accesskey="p" href="Note.html#Note">Note</a>,
  31. Up:&nbsp;<a rel="up" accesskey="u" href="Metrics-and-Maintenance.html#Metrics-and-Maintenance">Metrics and Maintenance</a>
  32. <hr>
  33. </div>
  34. <h5 class="subsubsection">2.7.7.3 Profile</h5>
  35. <p>The virtual machine supports a profiling capability by way of this
  36. <a name="index-g_t_0040file_007bprofile_002etxt_007d-284"></a>feature. Profiling an application causes run time statistics about it to
  37. be written to a file <samp><span class="file">./profile.txt</span></samp>. Profiled applications are of
  38. the form indicated in the following theorem
  39. <dl>
  40. <dt><em>T12</em><dd>[[<code>profile</code>]] <code>(</code><var>f</var><code>,</code><var>s</var><code>)</code> = <code>((nil,nil),((nil,nil),(nil,((</code><var>f</var><code>,</code><var>s</var><code>),nil))))</code>
  41. </dl>
  42. <p class="noindent">where <var>f</var> stands for the virtual code of the application, and
  43. <var>s</var> stands for the name of it to be written to the file.
  44. The semantics of a profiled function is identical to the unprofiled
  45. form for any non-<code>nil</code> <var>f</var>.
  46. <dl>
  47. <dt><em>P9</em><dd>([[<code>profile</code>]] <code>(</code><var>f</var><code>,</code><var>s</var><code>)</code>) <var>x</var> = <var>f</var> <var>x</var>
  48. </dl>
  49. <p>Unlike the situation with <code>note</code>, the annotation <var>s</var> of
  50. <a name="index-g_t_0040code_007bnote_007d-285"></a>used in profiled code is not in an unrestricted format but must be a
  51. character string in the standard representation (as in
  52. <a href="Representation-of-Numeric-and-Textual-Data.html#Representation-of-Numeric-and-Textual-Data">Representation of Numeric and Textual Data</a>),
  53. because this string needs to be written by <code>avram</code> to the file
  54. <samp><span class="file">./profile.txt</span></samp>. Ordinarily this string will be the source code
  55. identifier of the function being profiled.
  56. <p>When profiles are used in many parts of an application, an informative
  57. table is generated showing the time spent in each part.
  58. </body></html>