1
AutoLISP (Vanilla / Visual) / Re: most common value in a list (mode)
« Last post by Lee Mac on Today at 07:05:33 AM »Since you're already shortening the list using vl-remove-if with each iteration, it's more efficient to iterate until the list is exhausted rather than using a fixed iteration over the entire original list, e.g.:
Code - Auto/Visual Lisp: [Select]
- (while lst
- )
- )
- )
- rtn
- )
Code - Auto/Visual Lisp: [Select]
- Benchmarking .............Elapsed milliseconds / relative speed for 1024 iteration(s):
- (MODE L 0.01)......1782 / 2.49 <fastest>
- (@MODE L 0.01).....4437 / 1.00 <slowest>