Re: m.*! not native?
Raymond Toy <[email protected]>
| Newsgroups | gmane.lisp.matlisp.user |
|---|---|
| Message-ID | <[email protected]> |
>>>>> "Jefferson" == Jefferson Provost <[email protected]> writes: Jefferson> On 2/1/02 7:28 AM, "Raymond Toy" <[email protected]> wrote: Jefferson> D = 1x500 real matrix >> >> You do realize that a*b is O(500^3), a+b is O(500^2) and c*d is also >> O(500^2). So it's not surprising that a*b takes 157 times longer than >> a+b and 88 times longer than c*d. Jefferson> Yes, I realize that. But I wasn't doing a*b, I was doing a.*b, which is Jefferson> O(500x500), same as a+b, and c*d. Sorry, I missed the dot! You are right. A peek at the generated code on Solaris seems to show that we are calling out to generic functions way too often and could be vastly optimized. I know with CMUCL, a Lisp version of m+ was almost as fast (< 5% slower?) than Fortran, so m.* should be as fast, even in Lisp. I'll look in to it soon. Ray