Code: Select all
> (time
> (dotimes (i 10000)
> (dotimes (j 200)
> (set 'b (nth j a)))))
1927
> (time
> (dotimes (i 10000)
> (dotimes (j 200)
> (set 'b (j a)))))
55874
But documentation says:
When 'a is a string of 200 spaces, then the difference is less dramatic - nth is only about 1.5 times faster.Implicit indexing is slightly faster then indexing using nth and can take an unlimited number of indexes.
Interesting, that slice and implicit slice timings has no such difference either for lists and strings.
newlisp ver. is 8.8.0-p2