Port-vax archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Some timing tests...



Hm, I did send this to the mailing list last year, but it don't seem to have reached it (not in the archives...?)
Well, let's try again.  This is the third time :-)

-------- Vidarebefordrat meddelande --------
Ämne:   Some timing tests...
Datum:  Sun, 15 Apr 2018 14:36:15 +0200
Från:   Anders Magnusson <ragge%ludd.ltu.se@localhost>
Till:   port-vax List <port-vax%NetBSD.org@localhost>


Hi all,

while searching after why the vax port has gotten so slow, I noticed that there are a significant increase of function calls everywhere. While it is a well-known fact that the current calling convertion on vax is slow, I decided to get some real numbers.

I tested on a moderately slow vax (3100/48 I think?) and timed this small program:

    movl $10000000,%r0
1:  sobgtr %r0,1b
    halt

Basically it just loops 10 million times.
With L1 cache turned off it took 11 seconds (roughly 1Mips).
Turning on the cache did drop to 4.5s (two MIPS)

So, adding calls/ret to the same code:

    movl $10000000,%r0
1:  calls $0,2f
    sobgtr %r0,1b
    halt
2:  .word 0
    ret

without cache (which could symbolize a cache miss) it took 83s.
Removing time for sobgtr it means a calls/ret pair takes 7.2us for a cache miss. Turning on cache made it take just over 42s, which means that a hit takes 3.8us.

Doing the same with jsb/rsb:

    movl $10000000,%r0
1:  jsb 2f
    sobgtr %r0,1b
    halt
2:  rsb

this took 37us without cache, giving 2.6us uncached.
With cache, it only took just over 12 (!) us, giving .8us for this pair.

This is quite interesting numbers.  Changing the vax calling convention to use jsb/rsb + args in regs would be something quite interesting to do, since it seems to take 1/5 in speed compared to calls/ret.

-- Ragge



Home | Main Index | Thread Index | Old Index