Hi guys,
just out of curiosity I attempted this:
(defun CompareSpeed
( fL
/ L f time timeL
) ); repeat
); foreach
); defun CompareSpeed
The test performed:
(CompareSpeed ; Compare the speed of different iterators
'(
(mapcara
(mapcar 'f L
) ) ; using apostrophe ); list
); speedtest
And these are the results I got:
; "REPEAT = 0.7468"
; "FOREACH = 0.6687"
; "WHILENOCHECK = 0.688533"
; "WHILEWITHCHECK = 0.7"
; "RECURSIONNOCHECK = 0.70624"
; "RECURSIONWITHCHECK = 0.708833"
; "MAPCARA = 0.691514"
; "MAPCARF = 0.678925"
; "VL-SOME = 0.725356"
; "VL-EVERY = 0.76282"
Its my first time attempting speed test, so my questions are:
- Does the above seem correct?
- How would you perform speed test for a coupe of functions?
I thought that the most handy and readable way would be to have a subfunction like the above one (and maybe even vl-sort the results at the end).