< .. > tho even in '98 chances are a variant of that algorithm was about 40 years old.
std-firstn uses (length) function, therefore it _always_ runs till the end of a list. This behavior can be slow with a large lists.
Agree that the use of length has negligible affect on performance, but feel that std-firstn could be better optimised when n>length/2, e.g.:std-firstn uses (length) function, therefore it _always_ runs till the end of a list. This behavior can be slow with a large lists.Disagree, std-firstn is fine as is and its performance negligibly impacted by the size of the list it processes.
I'd need to see some compelling evidence to warrant that sort of algorithm for the general usage
Yes it does make a difference for large quantities on large data lists.
My testing shows the difference is not as significant as shown by your test .. interesting.
Thanks for the option Lee.
Thanks for the mod Lee.
;another approach with member 03-19-2008
(defun ALE_List_ReverseMember (NthPos In_Lst / InRLst NthItm)
(cond
( (> NthPos (length In_Lst)) In_Lst)
( (> NthPos 500)
(setq InRLst (reverse In_Lst) NthItm (nth NthPos In_Lst))
(while
(/=
NthPos
(length (setq InRLst (cdr (member NthItm InRLst))))
)
)
(reverse InRLst)
)
( T
(repeat NthPos
(setq
InRLst (cons (car In_Lst) InRLst)
In_Lst (cdr In_Lst)
)
)
(reverse InRLst)
)
)
)
(ALE_LIST_REVERSEMEMBER 10 ALIST).........3869 / 61.53 <fastest>
(FIRSTN 10 ALIST).........................4743 / 50.19
(FIRSTN 4000 ALIST)......................44492 / 5.35
(ALE_LIST_REVERSEMEMBER 4000 ALIST)......60419 / 3.94
(FIRSTN 3000 ALIST)......................74568 / 3.19
(ALE_LIST_REVERSEMEMBER 3000 ALIST).....238073 / 1 <slowest>
(FIRSTN 10 ALIST2).....................1887 / 1.19 <fastest>
(ALE_LIST_REVERSEMEMBER 10 ALIST2).....2246 / 1 <slowest>
(ALE_LIST_REVERSEMEMBER 3000 ALIST2).....3042 / 1.19 <fastest>
(FIRSTN 3000 ALIST2).....................3619 / 1 <slowest>
(ALE_LIST_REVERSEMEMBER 3980 ALIST2).....1684 / 1.16 <fastest>
(FIRSTN 3980 ALIST2).....................1950 / 1 <slowest>
(defun FirstN_MP ( n lst / len foo boo bar )
(defun foo ( n lst / result )
(repeat n
(setq
result (cons (car lst) result)
lst (cdr lst)
)
)
(reverse result)
)
(defun boo ( n k lst func )
(repeat (/ (- (length lst) n) k)
(setq lst (func lst))
)
lst
)
(defun bar ( n lst / result )
(setq result (reverse lst))
(foreach pair '((4 cddddr)(3 cdddr)(2 cddr)(1 cdr))
(setq result (boo n (car pair) result (eval (cadr pair))))
)
(reverse result)
)
(if (< (setq n (min n (setq len (length lst)))) (/ len 5))
(foo n lst)
(bar n lst)
)
)
(setq Alist2 (atoms-family 1))
(length Alist2) 3983
(FIRSTN_LM2 10 ALIST2).................1373 / 1.48 <fastest>
(ALE_LIST_REVERSEMEMBER 10 ALIST2).....2028 / 1 <slowest>
(FIRSTN_LM2 1000 ALIST2).................1529 / 1.86 <fastest>
(ALE_LIST_REVERSEMEMBER 1000 ALIST2).....2839 / 1 <slowest>
(FIRSTN_LM2 2000 ALIST2).................1263 / 1.1 <fastest>
(ALE_LIST_REVERSEMEMBER 2000 ALIST2).....1389 / 1 <slowest>
(ALE_LIST_REVERSEMEMBER 3000 ALIST2).....1341 / 1.11 <fastest>
(FIRSTN_LM2 3000 ALIST2).................1482 / 1 <slowest>
(ALE_LIST_REVERSEMEMBER 3980 ALIST2).....1341 / 1.01 <fastest>
(FIRSTN_LM2 3980 ALIST2).................1357 / 1 <slowest>
(defun FirstN_MP2 ( n lst )
(reverse
( (lambda ( lst n f ) (f n 1 (f n 4 lst cddddr) cdr))
(reverse lst)
(min n (length lst))
(lambda ( n i lst f )
(repeat (/ (- (length lst) n) i)
(setq lst (f lst))
)
lst
)
)
)
)
Code: [Select](defun FirstN_MP2 ( n lst )
...
)
Cool thread guys; interesting results --
Would have been nice if lisp had list slicing and stepping similar to Python.
This lack in functionality has always sort of surprised me considering lisps list based structure.Code - Python: [Select]
seq = L[start:stop:step]
Would have been nice if lisp had list slicing and stepping similar to Python.
(defun sublist (lst start len)
(firstn len (nthcdr start lst)))
Yes, the thing I wanted to point is the lack of other data structure than linked list in AutoLISP.
Would have been nice if lisp had list slicing and stepping similar to Python.
(defun sublist ( lst stel enel )
(reverse (member enel (reverse (member stel lst))))
)
(defun sublist ( lst st en )
(reverse (member (nth (- en 1) lst) (reverse (member (nth (- st 1) lst) lst))))
)
(defun sublist ( lst st en / n )
(setq n (length lst))
(repeat (- st 1)
(setq lst (cdr lst))
)
(setq lst (reverse lst))
(repeat (- n en)
(setq lst (cdr lst))
)
(reverse lst)
)
(defun ALE_List_MapcarToLength (LstLen In_Lst / Countr OutLst)
(setq Countr 1)
(vl-catch-all-apply
'mapcar
(list
'(lambda (x)
(if (> Countr LstLen)
(exit)
(setq OutLst (cons x OutLst) Countr (1+ Countr))
)
)
In_Lst
)
)
(reverse OutLst)
)
; perhaps problems for excess length of string...
(defun ALE_List_CdrToLength2 (n l / s p)
(setq n (- (length l) n) s "" c 0 p "")
(repeat (/ n 4) (setq s (strcat "(cddddr " s) c (1+ c)))
(repeat (rem n 4) (setq s (strcat "(cdr " s) c (1+ c)))
(repeat (1+ c) (setq p (strcat ")" p)))
(eval (read (strcat "(reverse " s "(reverse l)" p)))
)
;--------
(defun ALE_List_Cd100r (l)
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr l)))))))))))))))))))))))))
)
;
(defun ALE_List_CdrToLength (n l / s p c)
(setq l (reverse l) n (- (length l) n) s "" c 0 p "")
(repeat (/ n 100) (setq l (ALE_List_Cd100r l)))
(repeat (rem n 100) (setq s (strcat "(cdr " s) c (1+ c)))
(repeat (1+ c) (setq p (strcat ")" p)))
(eval (read (strcat "(reverse " s " l" p)))
)
(setq aList2 '(1 2 3 4 5 6 7 8 9 0 11))
(repeat 20 (setq aList2 (append aList2 aList2)))
Comando: (length Alist2)
11534336
(ALE_LIST_CDRTOLENGTH 5767100 ALIST2).....2871 / 1.73 <fastest>
(FIRSTN_MP2 5767100 ALIST2)...............3120 / 1.59
(FIRSTN_LM2 5767100 ALIST2)...............4961 / 1 <slowest>
(defun ale_list_cdrtolength2 ( n l / s p )
(setq l (reverse l)
n (- (length l) n)
s '(" l)")
)
(repeat (/ n 100) (setq l (ale_list_cd100r l)))
(repeat (rem n 100) (setq s (cons "(cdr" s) p (cons ")" p)))
(eval (read (apply 'strcat (cons "(reverse " (append s p)))))
)
Interesting approach Marc :)Thanks Lee, yes:
...
(defun ALE_List_CdrByLength ( n l / s p )
(setq n (- (length l) n)
s '(" l")
)
(repeat (/ n 100) (setq l (ale_list_cd100r l)))
(repeat (rem n 100) (setq s (cons "(cdr" s) p (cons ")" p)))
(eval (read (apply 'strcat (append s p))))
)
(defun ALE_List_ReverseCdrByLength ( n l / s p )
(setq l (reverse l)
n (- (length l) n)
s '(" l)")
)
(repeat (/ n 100) (setq l (ale_list_cd100r l)))
(repeat (rem n 100) (setq s (cons "(cdr" s) p (cons ")" p)))
(eval (read (apply 'strcat (cons "(reverse " (append s p)))))
)
(defun ALE_List_Sub (l i n)
(ALE_List_CdrByLength i (ALE_List_ReverseCdrByLength (+ i n) l))
)
(setq aList '(1 2 3 4 5 6 7 8 9 0 11))(repeat 18 (setq aList (append aList aList)))
(length Alist) > 2883584
(defun ALE_List_Cd1000r (l)
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr l))))))))))))
)))))))))))))))))))))))))))))))))))))))))))))))))
)))))))))))))))))))))))))))))))))))))))))))))))))
)))))))))))))))))))))))))))))))))))))))))))))))))
)))))))))))))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))))))))
)
(defun ALE_List_CdrByLength ( n l / s p )
(setq n (- (length l) n)
s '(" l")
)
(repeat (/ n 1000) (setq l (ALE_List_Cd1000r l)))
(repeat (/ (setq n (rem n 1000)) 100) (setq l (ALE_List_Cd100r l)))
(eval (read (apply 'strcat (append s p))))
)
(defun ALE_List_ReverseCdrByLength ( n l / s p )
(setq l (reverse l)
n (- (length l) n)
s '(" l)")
)
(repeat (/ n 1000) (setq l (ALE_List_Cd1000r l)))
(repeat (/ (setq n (rem n 1000)) 100) (setq l (ALE_List_Cd100r l)))
(repeat (rem n 100) (setq s (cons "(cdr" s) p (cons ")" p)))
(eval (read (apply 'strcat (cons "(reverse " (append s p)))))
)
(ALE_LIST_REVERSECDRBYLENGTH 1441700...).....1311 / 1.9 <fastest>
(FIRSTN_MP2 1441700 ALIST)...................1810 / 1.38
(FIRSTN_LM2 1441700 ALIST)...................2496 / 1 <slowest>
(defun ALE_List_CdrByLen (n l)
(setq n (- (length l) n))
(repeat (/ n 1000) (setq l (Cd1000r l)))
(repeat (/ (setq n (rem n 1000)) 100) (setq l (Cd100r l)))
(repeat (/ (setq n (rem n 100)) 10) (setq l (Cd10r l)))
(repeat (/ (setq n (rem n 10)) 4) (setq l (cddddr l)))
(repeat (rem n 4) (setq l (cdr l)))
l
)
(defun ALE_List_RevCdrByLen (n l)
(setq l (reverse l) n (- (length l) n))
(repeat (/ n 1000) (setq l (Cd1000r l)))
(repeat (/ (setq n (rem n 1000)) 100) (setq l (Cd100r l)))
(repeat (/ (setq n (rem n 100)) 10) (setq l (Cd10r l)))
(repeat (/ (setq n (rem n 10)) 4) (setq l (cddddr l)))
(repeat (rem n 4) (setq l (cdr l)))
(reverse l)
)
(defun Cd10r (l)
(cddddr(cddddr(cddr l)))
)
(defun Cd100r (l)
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr l)))))))))))))))))))))))))
)
(defun Cd1000r (l)
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr(cddddr
(cddddr(cddddr(cddddr(cddddr(cddddr l))))))))))))
)))))))))))))))))))))))))))))))))))))))))))))))))
)))))))))))))))))))))))))))))))))))))))))))))))))
)))))))))))))))))))))))))))))))))))))))))))))))))
)))))))))))))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))))))))
)
(defun ALE_List_Sub (l i n)
(ALE_List_CdrByLen i (ALE_List_RevCdrByLen (+ i n) l))
)
(setq Alist (atoms-family 1))
(length aList) > 4005
Elapsed milliseconds / relative speed for 4096 iteration(s):
(FIRSTN_LM2 3800 ALIST)...............2043 / 1.5 <fastest>
(FIRSTN_MP2 3800 ALIST)...............2996 / 1.02
(ALE_LIST_REVCDRBYLEN 3800 ALIST).....3058 / 1 <slowest>
Elapsed milliseconds / relative speed for 2048 iteration(s):
(ALE_LIST_REVCDRBYLEN 3000 ALIST).....1840 / 1.48 <fastest>
(FIRSTN_LM2 3000 ALIST)...............2652 / 1.02
(FIRSTN_MP2 3000 ALIST)...............2714 / 1 <slowest>
Elapsed milliseconds / relative speed for 2048 iteration(s):
(ALE_LIST_REVCDRBYLEN 2000 ALIST).....1950 / 1.75 <fastest>
(FIRSTN_MP2 2000 ALIST)...............2387 / 1.43
(FIRSTN_LM2 2000 ALIST)...............3417 / 1 <slowest>
Elapsed milliseconds / relative speed for 4096 iteration(s):
(ALE_LIST_REVCDRBYLEN 1000 ALIST).....1638 / 1.76 <fastest>
(FIRSTN_LM2 1000 ALIST)...............2074 / 1.39
(FIRSTN_MP2 1000 ALIST)...............2886 / 1 <slowest>
Elapsed milliseconds / relative speed for 32768 iteration(s):
(FIRSTN_LM2 10 ALIST)................3245 / 10.88 <fastest>
(ALE_LIST_REVCDRBYLEN 10 ALIST).....13182 / 2.68
(FIRSTN_MP2 10 ALIST)...............35319 / 1 <slowest>
;20140107 - Mixed version for short lists
(defun ALE_List_RevCdrByLen (n l / r)
(cond
( (> n 1000)
(setq l (reverse l) n (- (length l) n))
(repeat (/ n 1000) (setq l (Cd1000r l)))
(repeat (/ (setq n (rem n 1000)) 100) (setq l (Cd100r l)))
(repeat (/ (setq n (rem n 100)) 10) (setq l (Cd10r l)))
(repeat (/ (setq n (rem n 10)) 4) (setq l (cddddr l)))
(repeat (rem n 4) (setq l (cdr l)))
(reverse l)
)
( T
(repeat (/ n 10)
(setq
r
(vl-list*
(cadddr (cddddr (cddr l))) (cadddr (cddddr (cdr l)))
(cadddr (cddddr l)) (cadddr (cdddr l)) (cadddr (cddr l))
(cadddr (cdr l)) (cadddr l) (caddr l) (cadr l) (car l) r
)
l (cddddr (cddddr (cddr l)))
)
)
(repeat (rem n 10) (setq r (cons (car l) r) l (cdr l) ))
(reverse r)
)
)
)
Would have been nice if lisp had list slicing and stepping similar to Python.
(defun _Slice ( n1 n2 lst / prune normal a b n )
;; Normal result order:
;; (_Slice 2 5 '(0 1 2 3 4 5 6 7 8 9))
;; >> (2 3 4 5)
;;
;; Reversed result order:
;; (_Slice 5 2 '(0 1 2 3 4 5 6 7 8 9))
;; >> (5 4 3 2)
;;
;; Boundary safe:
;; (_Slice -5 100 '(0 1 2 3 4 5 6 7 8 9))
;; >> (0 1 2 3 4 5 6 7 8 9)
(defun prune ( n lst )
(repeat (/ n 4) (setq lst (cddddr lst)))
(repeat (rem n 4) (setq lst (cdr lst)))
lst
)
(setq
a (max 0 (if (setq normal (< n1 n2)) n1 n2))
b (min (1- (length lst)) (if normal n2 n1))
n (1- (- (length lst) b))
)
(if normal
(reverse (prune n (reverse (prune a lst))))
(prune n (reverse (prune a lst)))
)
)
(defun _Slice ( n1 n2 lst / a b normal result )
(setq
a (max 0 (if (setq normal (< n1 n2)) n1 n2))
b (min (1- (length lst)) (if normal n2 n1))
)
(repeat (- b (setq a (1- a)))
(setq result
(cons
(nth (setq a (1+ a)) lst)
result
)
)
)
(if normal
(reverse result)
result
)
)
(setq
a (max 0 (if (setq normal (< n1 n2)) n1 n2))
b (min (1- (length lst)) (if normal n2 n1))
n (1- (- (length lst) b))
)
(if normal
To:(setq
a (max 0 (min n1 n2))
b (min (length lst) (1+ (max n1 n2)))
n (- (length lst) b)
)
(if (< n1 n2)
...
Or, more compactly:(setq
a (max 0 (min n1 n2))
n (- (length lst) (min (length lst) (1+ (max n1 n2))))
)
(if (< n1 n2)
...
(defun ALE_List_Slice (i n l)
(ALE_List_CdrByLen (1+ (- n i)) (ALE_List_RevCdrByLen (1+ n) l))
)
(defun ALE_List_CdrByLen (n l / r g)
(setq g (- (length l) n))
(cond
( (> g 1000)
(repeat (/ g 1000) (setq l (Cd1000r l)))
(repeat (/ (setq g (rem g 1000)) 100) (setq l (Cd100r l)))
(repeat (/ (setq g (rem g 100)) 10) (setq l (Cd10r l)))
(repeat (/ (setq g (rem g 10)) 4) (setq l (cddddr l)))
(repeat (rem g 4) (setq l (cdr l)))
l
)
( T
(setq l (reverse l))
(repeat (/ n 10)
(setq
r
(vl-list*
(cadddr (cddddr (cddr l))) (cadddr (cddddr (cdr l)))
(cadddr (cddddr l)) (cadddr (cdddr l)) (cadddr (cddr l))
(cadddr (cdr l)) (cadddr l) (caddr l) (cadr l) (car l) r
)
l (cddddr (cddddr (cddr l)))
)
)
(repeat (rem n 10) (setq r (cons (car l) r) l (cdr l) ))
r
)
)
)
Benchmark.lsp | © 2005 Michael Puckett | All Rights Reserved
List > '(0 1 2 3 4 5 6 7 8 9)
Elapsed milliseconds / relative speed for 32768 iteration(s):
(_SLICE 2 6 (QUOTE (0 1 2 3 4 5 6 7 ...).....1248 / 1.06 <fastest>
(ALE_LIST_SLICE 2 6 (QUOTE (0 1 2 3 ...).....1326 / 1 <slowest>
> (setq Alist (atoms-family 1))
> (length aList) > 4005
Elapsed milliseconds / relative speed for 1024 iteration(s):
(_SLICE 101 4000 ALIST).............1061 / 3.22 <fastest>
(ALE_LIST_SLICE 101 4000 ALIST).....3417 / 1 <slowest>
Elapsed milliseconds / relative speed for 1024 iteration(s):
(_SLICE 101 3000 ALIST).............1076 / 2.67 <fastest>
(ALE_LIST_SLICE 101 3000 ALIST).....2870 / 1 <slowest>
Elapsed milliseconds / relative speed for 1024 iteration(s):
(_SLICE 101 2000 ALIST).............1123 / 1.89 <fastest>
(ALE_LIST_SLICE 101 2000 ALIST).....2121 / 1 <slowest>
Elapsed milliseconds / relative speed for 1024 iteration(s):
(_SLICE 101 1000 ALIST).............1045 / 1.28 <fastest>
(ALE_LIST_SLICE 101 1000 ALIST).....1342 / 1 <slowest>
Elapsed milliseconds / relative speed for 2048 iteration(s):
(ALE_LIST_SLICE 101 800 ALIST).....1919 / 1.07 <fastest>
(_SLICE 101 800 ALIST).............2059 / 1 <slowest>
Elapsed milliseconds / relative speed for 4096 iteration(s):
(ALE_LIST_SLICE 101 400 ALIST).....1857 / 2.31 <fastest>
(_SLICE 101 400 ALIST).............4290 / 1 <slowest>
Elapsed milliseconds / relative speed for 8192 iteration(s):
(ALE_LIST_SLICE 101 200 ALIST).....1763 / 4.68 <fastest>
(_SLICE 101 200 ALIST).............8252 / 1 <slowest>
Elapsed milliseconds / relative speed for 8192 iteration(s):
(ALE_LIST_SLICE 10 101 ALIST).....1155 / 7.24 <fastest>
(_SLICE 10 101 ALIST).............8362 / 1 <slowest>
Elapsed milliseconds / relative speed for 2048 iteration(s):
(_SLICE 1010 3000 ALIST).............1935 / 1.14 <fastest>
(ALE_LIST_SLICE 1010 3000 ALIST).....2199 / 1 <slowest>
Elapsed milliseconds / relative speed for 2048 iteration(s):
(ALE_LIST_SLICE 1010 2000 ALIST).....1856 / 1.06 <fastest>
(_SLICE 1010 2000 ALIST).............1966 / 1 <slowest>
Elapsed milliseconds / relative speed for 2048 iteration(s):
(_SLICE 1000 1010 ALIST).............1825 / 1.03 <fastest>
(ALE_LIST_SLICE 1000 1010 ALIST).....1872 / 1 <slowest>
Elapsed milliseconds / relative speed for 2048 iteration(s):
(_SLICE 800 1010 ALIST).............1981 / 1.09 <fastest>
(ALE_LIST_SLICE 800 1010 ALIST).....2153 / 1 <slowest>
Elapsed milliseconds / relative speed for 2048 iteration(s):
(_SLICE 400 1010 ALIST).............1997 / 1.16 <fastest>
(ALE_LIST_SLICE 400 1010 ALIST).....2309 / 1 <slowest>
Elapsed milliseconds / relative speed for 1024 iteration(s):
(_SLICE 200 1010 ALIST).............1014 / 1.29 <fastest>
(ALE_LIST_SLICE 200 1010 ALIST).....1311 / 1 <slowest>
Elapsed milliseconds / relative speed for 1024 iteration(s):
(_SLICE 10 1010 ALIST).............1123 / 1.36 <fastest>
(ALE_LIST_SLICE 10 1010 ALIST).....1529 / 1 <slowest>
(setq Alist (atoms-family 1))
(repeat 10 (setq Alist (append Alist Alist)))
(length aList) > 4100096
Elapsed milliseconds / relative speed for 2 iteration(s):
(ALE_LIST_SLICE 101 4000 ALIST).....1217 / 1.59 <fastest>
(_SLICE 101 4000 ALIST).............1935 / 1 <slowest>
Elapsed milliseconds / relative speed for 2 iteration(s):
(ALE_LIST_SLICE 101 3000 ALIST).....1092 / 1.76 <fastest>
(_SLICE 101 3000 ALIST).............1919 / 1 <slowest>
Elapsed milliseconds / relative speed for 2 iteration(s):
(ALE_LIST_SLICE 101 2000 ALIST).....1092 / 1.76 <fastest>
(_SLICE 101 2000 ALIST).............1919 / 1 <slowest>
Elapsed milliseconds / relative speed for 2 iteration(s):
(ALE_LIST_SLICE 101 1000 ALIST).....1139 / 1.68 <fastest>
(_SLICE 101 1000 ALIST).............1919 / 1 <slowest>
Elapsed milliseconds / relative speed for 128 iteration(s):
(ALE_LIST_SLICE 101 800 ALIST).......1030 / 168.01 <fastest>
(_SLICE 101 800 ALIST).............173052 / 1 <slowest>
Elapsed milliseconds / relative speed for 1024 iteration(s):
(ALE_LIST_SLICE 101 400 ALIST)........1248 / 1171.02 <fastest>
(_SLICE 101 400 ALIST).............1461433 / 1 <slowest>
Elapsed milliseconds / relative speed for 2048 iteration(s):
(ALE_LIST_SLICE 101 200 ALIST)........1685 / 1423.59 <fastest>
(_SLICE 101 200 ALIST).............2398750 / 1 <slowest>
Benchmarking ..............; errore: Funzione annullata