home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / forth / 3643 < prev    next >
Encoding:
Text File  |  1992-12-18  |  3.5 KB  |  101 lines

  1. Newsgroups: comp.lang.forth
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!malgudi.oar.net!caen!destroyer!sol.ctr.columbia.edu!venezia!penev
  3. From: penev@venezia (Penio Penev)
  4. Subject: Re: Threading speed
  5. References: <1992Dec17.142351.8752@email.tuwien.ac.at>
  6. Sender: nobody@ctr.columbia.edu
  7. Organization: Rockefeller University
  8. Date: Fri, 18 Dec 1992 00:18:49 GMT
  9. X-Newsreader: TIN [version 1.1 PL6]
  10. Message-ID: <1992Dec18.001849.22535@sol.ctr.columbia.edu>
  11. Reply-To: penev@venezia.rockefeller.edu
  12. X-Posted-From: venezia.rockefeller.edu
  13. NNTP-Posting-Host: sol.ctr.columbia.edu
  14. Lines: 85
  15.  
  16. Anton Ertl (anton@mips.complang.tuwien.ac.at) wrote:
  17. : The benchmark consists of a loop that contains nine NEXTs and a
  18. : looping instruction (a termination test and a jump back for subroutine
  19. : threaded code), i.e. it primarily measures NEXT speed. This loop is
  20. : executed 10,000,000 times (resulting in 100,000,000 NEXTs and a bit of
  21. : overhead). It fits completely into the caches of the measured
  22. : machines.
  23. : I posted the code a few months ago. If you are interested, I will mail
  24. : it to you.
  25.  
  26. I am new to this group and I have not seen the original posting. I'd
  27. be interseded to know what this test measures. 
  28.  
  29. I get the following measurements on my machine:
  30.  
  31. : DUMMY ; 
  32. CODE CDUMMY ret ok
  33. : DD  FOR DUMMY NEXT ; ok
  34. : CC FOR CDUMMY NEXT ; 
  35. : TARA  FOR NEXT ; ok
  36. COUNTER 100000000 TARA TIMER 13000 ok
  37. COUNTER 100000000 DD   TIMER 31000 ok
  38. COUNTER 100000000 CC   TIMER 25000 ok
  39.  
  40. The timer is in miliseconds, the resolution is 1 second.
  41.  
  42. This is overall time by the (date&time system call) on an unburdened
  43. machine.
  44.  
  45. The machine: SGI Indigo, R3000, 33 MHz. 
  46. Here is how the obect code looks like (via dbx with a break point at b
  47. for easy entering):
  48.  
  49.  
  50. ' DUMMY b [3] Process  2944 (pf) stopped at [b, :$10000028]
  51. *[b, 0x10000028]        
  52.  
  53. >ua $s0
  54.  [RETRY, 0x100109e4]    addiu   sp,sp,-4                 PP> DUMMY
  55.  [RETRY, 0x100109e8]    addiu   sp,sp,4                PP> ;
  56.  [RETRY, 0x100109ec]    jr      ra
  57.  [RETRY, 0x100109f0]    lw      ra,4(sp)
  58.  [RETRY, 0x100109f4]    spec05  zero,zero,zero
  59.  [RETRY, 0x100109f8]    b       0x100103ec
  60.  [RETRY, 0x100109fc]    bgezl   s2,0x10021b54
  61.  [RETRY, 0x10010a00]    c3.10   0
  62.  [RETRY, 0x10010a04]    jr      ra                PP> CODE CDUMMY ret
  63.  [RETRY, 0x10010a08]    lw      ra,4(sp)
  64.  [RETRY, 0x10010a0c]    srl     zero,zero,0
  65.  [RETRY, 0x10010a10]    beq     zero,at,0x10013174
  66.  [RETRY, 0x10010a14]    sll     t0,a0,16
  67.  [RETRY, 0x10010a18]    addiu   sp,sp,-4            PP> : DD
  68.  [RETRY, 0x10010a1c]    move    ra,s0                PP> FOR
  69.  [RETRY, 0x10010a20]    addiu   sp,sp,-4
  70. >u
  71.  [RETRY, 0x10010a24]    lw      s0,0(s8)
  72.  [RETRY, 0x10010a28]    addiu   s8,s8,4
  73.  [RETRY, 0x10010a2c]    addiu   ra,ra,-1
  74.  [RETRY, 0x10010a30]    sw      ra,4(sp)            PP> here we branch from NEXT
  75.  [RETRY, 0x10010a34]    jal     RETRY                PP> DUMMY
  76.  [RETRY, 0x10010a38]    sw      ra,0(sp)
  77.  [RETRY, 0x10010a3c]    nop                    PP> NEXT Note, that the nop cannot be optimised.
  78.  [RETRY, 0x10010a40]    bne     ra,zero,0x10010a30
  79.  [RETRY, 0x10010a44]    addiu   ra,ra,-1
  80.  [RETRY, 0x10010a48]    lw      ra,8(sp)            
  81.  [RETRY, 0x10010a4c]    addiu   sp,sp,4
  82.  [RETRY, 0x10010a50]    addiu   sp,sp,4                PP> ; An optimisation for saving space possible here
  83.  [RETRY, 0x10010a54]    jr      ra
  84.  [RETRY, 0x10010a58]    lw      ra,4(sp)
  85.  [RETRY, 0x10010a5c]    nop
  86.  [RETRY, 0x10010a60]    add     a0,t3,v0
  87. >
  88.  
  89. The PP> comments are mine (Penio Penev>)
  90.  
  91. jal    Jump and link 
  92. ra    Return Address - register, where jal stores the return address
  93. s0    Top of Stack
  94. sp    Return stack pointer
  95. at    Temp register
  96.  
  97. -- Penio
  98.