implicit indexing performance question
Posted: Sun Apr 16, 2006 8:00 pm
Checking the performace of different indexing techniques, I found strange result:
'a is a list of 200 one-space elements.
But documentation says:
Interesting, that slice and implicit slice timings has no such difference either for lists and strings.
newlisp ver. is 8.8.0-p2
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