[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: map-array

| Based on the Code of Bill St.Clair for faster-climits I tried to write a
| general map-array function,
| both a mcl specific and a portable version.
| Then I compared this construct to mapc for sequences
| To my surprise, the mapping an array was slower than mapping over a list.
| Am I missing something ?


It is true that access to a specific element of an array in generaly faster
than access to a specific element of a list. But, in this case, we are not accessing elements individualy but mapping over the whole structure.

Mapping over an array involves accessing every element individualy (each
time having to do at least a multiplication and an addition) where as
mapping over a list involves simple pointer indirections which are very

* Guillaume Cartier                 (514) 844-5294 (maison)         *
* L.A.C.I.M.                        (514) 987-4290 (bureau)         *
* Universite du Quebec a Montreal   (514) 987-8477 (telecopieur)    *
* Montreal, Quebec, Canada          cartier@math.uqam.ca (internet) *