home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / xcmd / prctclxf.sit / DemoStack / card_7605.txt < prev    next >
Text File  |  1990-08-28  |  4KB  |  139 lines

  1. -- card: 7605 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 2685
  5. -- name: Benchmark
  6.  
  7.  
  8. -- part 1 (button)
  9. -- low flags: 00
  10. -- high flags: A003
  11. -- rect: left=326 top=32 right=54 bottom=426
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: Benchmark
  20. ----- HyperTalk script -----
  21. on mouseUp
  22.   set cursor to watch
  23.  
  24.   put return & "__________ Start benchmark" & return after card field "Output"
  25.  
  26.   -- Get time to execute simple repeat loop
  27.   -- The resulting time is subtracted from all other results.
  28.   put ticks() into start
  29.   repeat with i=1 to 100
  30.     put empty into nothing
  31.   end repeat
  32.   put ticks()-start into delta
  33.  
  34.   -- A null command causes ArrayList to do the minimum amount
  35.   -- of processing. All that happens is that the XFCN
  36.   -- is loaded by HyperCard, initializes itself, and then returns
  37.   -- almost immediately.
  38.   put "Time a null command: " after card field "Output"
  39.   put ticks() into start
  40.   repeat with i=1 to 100
  41.     get alist()
  42.   end repeat
  43.   put (ticks()-start-delta)/100 & return after card field "Output"
  44.  
  45.   -- A junk command causes ArrayList to execute its command decoding
  46.   -- functions. But, since it's a junk command, no action is taken.
  47.   put "Time a junk command: " after card field "Output"
  48.   put ticks() into start
  49.   repeat with i=1 to 100
  50.     get alist(junk)
  51.   end repeat
  52.   put (ticks()-start-delta)/100 & return after card field "Output"
  53.  
  54.   -- The search command with the list parameter causes ArrayList
  55.   -- to lookup the find command, and then to also look up the
  56.   -- named list. This test gives the time used to look up the
  57.   -- list.
  58.   put "Time list lookup: " after card field "Output"
  59.   put ticks() into start
  60.   repeat with i=1 to 100
  61.     get alist(search, list)
  62.   end repeat
  63.   put (ticks()-start-delta)/100 & return after card field "Output"
  64.  
  65.   -- Executes the search command with an empty list.
  66.   put "Time empty search on empty list: " after card field "Output"
  67.   put ticks() into start
  68.   repeat with i=1 to 100
  69.     get alist(search, list, "")
  70.   end repeat
  71.   put (ticks()-start-delta)/100 & return after card field "Output"
  72.  
  73.   -- This test is used for comparison with other timing tests
  74.   -- above.
  75.   put "Time size command: " after card field "Output"
  76.   put ticks() into start
  77.   repeat with i=1 to 100
  78.     get alist(size, list)
  79.   end repeat
  80.   put (ticks()-start-delta)/100 & return after card field "Output"
  81.  
  82.   put "__________ End benchmark" & return after card field "Output"
  83. end mouseUp
  84.  
  85.  
  86.  
  87. -- part 2 (field)
  88. -- low flags: 00
  89. -- high flags: 0007
  90. -- rect: left=255 top=65 right=301 bottom=508
  91. -- title width / last selected line: 0
  92. -- icon id / first selected line: 0 / 0
  93. -- text alignment: 0
  94. -- font id: 3
  95. -- text size: 10
  96. -- style flags: 0
  97. -- line height: 13
  98. -- part name: Output
  99.  
  100.  
  101. -- part contents for background part 9
  102. ----- text -----
  103. DemoStack 0.9
  104.  
  105. -- part contents for background part 1
  106. ----- text -----
  107. Benchmark
  108.  
  109. -- part contents for background part 12
  110. ----- text -----
  111. Card #9
  112.  
  113. -- part contents for card part 2
  114. ----- text -----
  115. Data for ArrayList on a standard MacPlus:
  116. __________ Start benchmark
  117. Time a null command: 2
  118. Time a junk command: 2.55
  119. Time list lookup: 3.35
  120. Time empty search on empty list: 3.44
  121. Time size command: 3.33
  122. __________ End benchmark
  123.  
  124.  
  125. -- part contents for background part 14
  126. ----- text -----
  127.  
  128.  
  129. This card contains some benchmarks which illustrate how long certain commands take to execute. The comments in the script of the "Benchmark" button explain what each time is. (All times are given as 1/60's of a second.)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137. -- part contents for background part 13
  138. ----- text -----
  139. Description