fork download
  1. (defparameter s '(-1 2 8 -9 -2 -3 -6 -10 -8 5 7 9 7))
  2. (defparameter n-times 4000000)
  3.  
  4. (time (loop repeat n-times
  5. do (loop for n in s
  6. if (oddp n)
  7. collect n into odds
  8. else
  9. collect n into evens
  10. finally (return (append odds evens)))))
  11.  
  12. (time (loop repeat n-times
  13. do (stable-sort (copy-seq s)
  14. (lambda (a b) (and (oddp a) (evenp b))))))
  15.  
  16. (time (loop repeat n-times
  17. with s = (list -1 2 8 -9 -2 -3 -6 -10 -8 5 7 9 7)
  18. do (stable-sort s (lambda (a b) (and (oddp a) (evenp b))))))
  19.  
  20. (time (loop repeat n-times
  21. do (append (remove-if #'evenp s)
  22. (remove-if #'oddp s))))
  23.  
Success #stdin #stdout 4.66s 31420KB
stdin
Standard input is empty
stdout
Evaluation took:
  0.541 seconds of real time
  0.536000 seconds of total run time (0.464000 user, 0.072000 system)
  [ Run times consist of 0.260 seconds GC time, and 0.276 seconds non-GC time. ]
  99.08% CPU
  1,893,600,410 processor cycles
  960,005,584 bytes consed
  
Evaluation took:
  1.907 seconds of real time
  1.904000 seconds of total run time (1.852000 user, 0.052000 system)
  [ Run times consist of 0.284 seconds GC time, and 1.620 seconds non-GC time. ]
  99.84% CPU
  6,675,168,090 processor cycles
  832,016,928 bytes consed
  
Evaluation took:
  0.949 seconds of real time
  0.948000 seconds of total run time (0.948000 user, 0.000000 system)
  99.89% CPU
  3,319,948,728 processor cycles
  0 bytes consed
  
Evaluation took:
  1.255 seconds of real time
  1.252000 seconds of total run time (1.196000 user, 0.056000 system)
  [ Run times consist of 0.204 seconds GC time, and 1.048 seconds non-GC time. ]
  99.76% CPU
  4,392,105,512 processor cycles
  832,018,096 bytes consed