Author Topic: list of first n elements from list  (Read 9209 times)

0 Members and 1 Guest are viewing this topic.

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1454
  • Marco
Re: list of first n elements from list
« Reply #30 on: January 05, 2014, 05:17:07 AM »
On very long list:
Code: [Select]
(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)))))
)
Code: [Select]
(ALE_LIST_REVERSECDRBYLENGTH 1441700...).....1311 / 1.9 <fastest>
(FIRSTN_MP2 1441700 ALIST)...................1810 / 1.38
(FIRSTN_LM2 1441700 ALIST)...................2496 / 1 <slowest>

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1454
  • Marco
Re: list of first n elements from list
« Reply #31 on: January 05, 2014, 08:59:28 AM »
These are pretty good also in short lists:
Code: [Select]
(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))
)
Code: [Select]
(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>

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1454
  • Marco
Re: list of first n elements from list
« Reply #32 on: January 07, 2014, 04:33:03 AM »
Code: [Select]
;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)
    )
  )
)

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: list of first n elements from list
« Reply #33 on: January 17, 2014, 10:25:52 AM »
Would have been nice if lisp had list slicing and stepping similar to Python.

I had need to do this very thing this week (to sample values within a list), ergo:

Code: [Select]
(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)))
    )
)

If one is taking relatively small slices the conventional approach:

Code: [Select]
(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
    )       

)

Executes faster, but as a general, all purpose slicer I found the first one performs quite well.

Cheers.
« Last Edit: January 18, 2014, 12:45:04 AM by MP »
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Lee Mac

  • Seagull
  • Posts: 12922
  • London, England
Re: list of first n elements from list
« Reply #34 on: January 18, 2014, 02:04:58 PM »
Good stuff MP  8-)

The only change I'd be inclined to make to your excellent code is changing:
Code: [Select]
(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:
Code: [Select]
(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:
Code: [Select]
(setq
    a (max 0 (min n1 n2))
    n (- (length lst) (min (length lst) (1+ (max n1 n2))))
)

(if (< n1 n2)
    ...

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1454
  • Marco
Re: list of first n elements from list
« Reply #35 on: January 19, 2014, 05:42:51 AM »
...needs to be optimized, but it can stand comparison.
Code: [Select]
(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
    )
  )
)

Code: [Select]
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>

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1454
  • Marco
Re: list of first n elements from list
« Reply #36 on: January 19, 2014, 11:33:35 AM »
on very big lists:
Code: [Select]
(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