Advertisement
Guest User

Untitled

a guest
May 8th, 2018
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 0.90 KB | None | 0 0
  1. CL-USER> (defparameter *list* (make-list 100000 :initial-element 1))
  2. *LIST*
  3. CL-USER> (defparameter *array* (make-array 100000 :initial-element 1))
  4. *ARRAY*
  5. CL-USER> (time (loop :repeat 10000 :do (nth 99000 *list*)))
  6. Evaluation took:
  7.   1.676 seconds of real time
  8.   1.640625 seconds of total run time (1.640625 user, 0.000000 system)
  9.   97.91% CPU
  10.   4,199,648,406 processor cycles
  11.   0 bytes consed
  12.  
  13. NIL
  14. CL-USER> (time (loop :repeat 10000 :do (elt *list* 99000)))
  15. Evaluation took:
  16.   0.000 seconds of real time
  17.   0.000000 seconds of total run time (0.000000 user, 0.000000 system)
  18.   100.00% CPU
  19.   148,006 processor cycles
  20.   0 bytes consed
  21.  
  22. NIL
  23. CL-USER> (time (loop :repeat 10000 :do (aref *array* 99000)))
  24. Evaluation took:
  25.   0.000 seconds of real time
  26.   0.000000 seconds of total run time (0.000000 user, 0.000000 system)
  27.   100.00% CPU
  28.   207,244 processor cycles
  29.   0 bytes consed
  30.  
  31. NIL
  32. CL-USER>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement