timer.notes 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. Some notes on the PSL "spectral" timing Tests
  2. Martin L. Griss
  3. March 17 1982
  4. The tests in the file PT:PSL-TIMER.SL (which is compiled and then
  5. driven by calls in PT:TIME-PSL.SL) have been gathered by us, with
  6. assistance/requests/suggestions from Fateman and Foderaro at Berkeley,
  7. JONL White and George Charrette at MIT, and Gabriel at Stanford as
  8. part of hist tests for the analysis of different LISP systems. They
  9. range over a number of LISP fundamentals, such as function calling
  10. speed, compiler quality, simple EVAL speed, INUM/FIXNUM arithmetic,
  11. CAR/CDR speeds, CONS speed, Type-testing predicates, etc. In most
  12. cases, the times quoted are for N iterations of some basic loop, with
  13. N fixed at some convenient quantity; the current N is given.
  14. The tests first set up some lists, which are then used for CDR'ing
  15. and counting loops. These are:
  16. LONGLIST 1664 elements
  17. TESTLIST 1002 elements
  18. TESTLIST2 2002 elements
  19. TEST N Description and comments
  20. Empty 10k Fastest Empty loop, using INUM or FIXNUM arithmetic
  21. as measure of overhead.
  22. SlowEmpty 10k Empty loop using generic arithmetic, usually
  23. much slower than Empty because of subroutine call.
  24. The loop indices are still in INUM range, and some
  25. implementations may opencode part of the arithmetic.
  26. Cdr1 100 Cdr down LONGLIST N times, using ATOM to terminate.
  27. The loop is done using INUM arithmetic
  28. If there is no INUM/FIXNUM arithmetic, this time is
  29. swamped by arithmetic time.
  30. In PSL, ATOM test requires TAG extraction, while
  31. NULL test is just an EQ with NIL. In some implementations
  32. CAR and CDR require the TAG to be masked off with an
  33. extra instruction, while in others the hardware ignores
  34. the tag field in addressing operations, speed this up.
  35. Cdr2 100 Cdr down LONGLIST N times, using NULL to terminate.
  36. Compare with CDR1 tests.
  37. Cddr 100 Cddr down LONGLIST N times, using NULL to terminate
  38. Note that some time CDDR is done better than just CDR
  39. since addressing modes may help.
  40. ListOnlyCdr1 Cdr down TESTLIST, length TESTLIST times, using NULL
  41. These LISTONLY... tests do not use arithmetic to loop.
  42. ListOnlyCddr Cddr down TESTLIST, length TESTLIST times, using NULL
  43. ListOnlyCdr2 Cdr down TESTLIST, length TESTLIST, using ATOM
  44. This does not use arithmetic to loop.
  45. ListOnlyCddr Cddr down TESTLIST2, length TESTLIST times, using ATOM.
  46. Reverse 10 Call system reverse on LONGLIST, N times.
  47. This CONS's a lot, also some SYSTEM reverse's
  48. handcoded, e.g. LISP 1.6.
  49. MyReverse1 10 Reverse compiled, using ATOM to terminate
  50. MyReverse2 10 Reverse compiled, using NULL to terminate
  51. Length 100 Built-in length, on LONGLIST.
  52. Arithmetic 10k Call FACTORIAL 9, N times, generic arithmetic.
  53. Looping as in EMPTYtest.
  54. Eval 10k EVAL EvalForm N times.
  55. EvalForm is (SETQ FOO (CADR '(1 2 3))) .
  56. tak 18 12 6 Gabriel's test function that has been used
  57. on MANY LISP systems. Using INUM/FIXNUM arithmetic.
  58. gtak 18 12 6 As above, using Generic arithmetic.
  59. gtsta g0 Charrete's FUNCALL/APPLY test. 100000 loops on
  60. (APPLY F (list I)) or (FUNCALL F I), whichever
  61. exists and is fastest in system. [PSL converts
  62. (APPLY F (list I)) into a fast-apply].
  63. g0 is a NOOP.
  64. gtsta g1 g1 calls ADD1