home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.forth
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!malgudi.oar.net!caen!destroyer!sol.ctr.columbia.edu!venezia!penev
- From: penev@venezia (Penio Penev)
- Subject: Re: Threading speed
- References: <1992Dec17.142351.8752@email.tuwien.ac.at>
- Sender: nobody@ctr.columbia.edu
- Organization: Rockefeller University
- Date: Fri, 18 Dec 1992 00:18:49 GMT
- X-Newsreader: TIN [version 1.1 PL6]
- Message-ID: <1992Dec18.001849.22535@sol.ctr.columbia.edu>
- Reply-To: penev@venezia.rockefeller.edu
- X-Posted-From: venezia.rockefeller.edu
- NNTP-Posting-Host: sol.ctr.columbia.edu
- Lines: 85
-
- Anton Ertl (anton@mips.complang.tuwien.ac.at) wrote:
- :
- : The benchmark consists of a loop that contains nine NEXTs and a
- : looping instruction (a termination test and a jump back for subroutine
- : threaded code), i.e. it primarily measures NEXT speed. This loop is
- : executed 10,000,000 times (resulting in 100,000,000 NEXTs and a bit of
- : overhead). It fits completely into the caches of the measured
- : machines.
- :
- : I posted the code a few months ago. If you are interested, I will mail
- : it to you.
- :
-
- I am new to this group and I have not seen the original posting. I'd
- be interseded to know what this test measures.
-
- I get the following measurements on my machine:
-
- : DUMMY ;
- CODE CDUMMY ret ok
- : DD FOR DUMMY NEXT ; ok
- : CC FOR CDUMMY NEXT ;
- : TARA FOR NEXT ; ok
- COUNTER 100000000 TARA TIMER 13000 ok
- COUNTER 100000000 DD TIMER 31000 ok
- COUNTER 100000000 CC TIMER 25000 ok
-
- The timer is in miliseconds, the resolution is 1 second.
-
- This is overall time by the (date&time system call) on an unburdened
- machine.
-
- The machine: SGI Indigo, R3000, 33 MHz.
- Here is how the obect code looks like (via dbx with a break point at b
- for easy entering):
-
-
- ' DUMMY b [3] Process 2944 (pf) stopped at [b, :$10000028]
- *[b, 0x10000028]
-
- >ua $s0
- [RETRY, 0x100109e4] addiu sp,sp,-4 PP> DUMMY
- [RETRY, 0x100109e8] addiu sp,sp,4 PP> ;
- [RETRY, 0x100109ec] jr ra
- [RETRY, 0x100109f0] lw ra,4(sp)
- [RETRY, 0x100109f4] spec05 zero,zero,zero
- [RETRY, 0x100109f8] b 0x100103ec
- [RETRY, 0x100109fc] bgezl s2,0x10021b54
- [RETRY, 0x10010a00] c3.10 0
- [RETRY, 0x10010a04] jr ra PP> CODE CDUMMY ret
- [RETRY, 0x10010a08] lw ra,4(sp)
- [RETRY, 0x10010a0c] srl zero,zero,0
- [RETRY, 0x10010a10] beq zero,at,0x10013174
- [RETRY, 0x10010a14] sll t0,a0,16
- [RETRY, 0x10010a18] addiu sp,sp,-4 PP> : DD
- [RETRY, 0x10010a1c] move ra,s0 PP> FOR
- [RETRY, 0x10010a20] addiu sp,sp,-4
- >u
- [RETRY, 0x10010a24] lw s0,0(s8)
- [RETRY, 0x10010a28] addiu s8,s8,4
- [RETRY, 0x10010a2c] addiu ra,ra,-1
- [RETRY, 0x10010a30] sw ra,4(sp) PP> here we branch from NEXT
- [RETRY, 0x10010a34] jal RETRY PP> DUMMY
- [RETRY, 0x10010a38] sw ra,0(sp)
- [RETRY, 0x10010a3c] nop PP> NEXT Note, that the nop cannot be optimised.
- [RETRY, 0x10010a40] bne ra,zero,0x10010a30
- [RETRY, 0x10010a44] addiu ra,ra,-1
- [RETRY, 0x10010a48] lw ra,8(sp)
- [RETRY, 0x10010a4c] addiu sp,sp,4
- [RETRY, 0x10010a50] addiu sp,sp,4 PP> ; An optimisation for saving space possible here
- [RETRY, 0x10010a54] jr ra
- [RETRY, 0x10010a58] lw ra,4(sp)
- [RETRY, 0x10010a5c] nop
- [RETRY, 0x10010a60] add a0,t3,v0
- >
-
- The PP> comments are mine (Penio Penev>)
-
- jal Jump and link
- ra Return Address - register, where jal stores the return address
- s0 Top of Stack
- sp Return stack pointer
- at Temp register
-
- -- Penio
-