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 1/31/02 5:40 PM, "Tunc Simsek" <[email protected]> wrote: >> what do you mean by native. both allegro and cmucl produce native code. >> looking at mtimes.lisp; it looks like all the declarations are in place >> for m.*! so the only reason that it may be slow is if the optimization >> flags were not set during compilation. I personally never checked that >> they are. It is worth checking this. Jefferson> Sorry, I misspoke: by native I meant to say implemented in fortran. Jefferson> Here are the average times of a few operations. Jefferson> operation | msecs (mean of 100 runs) Jefferson> -----------+--------- Jefferson> (m.*! a b) | 1351.6 Jefferson> (m.+! a b) | 8.6 Jefferson> (m* c d) | 15.2 Jefferson> A,B = 500x500 real-matrices Jefferson> C = 500x1 real matrix 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. To speed things up, you may want to get a copy of ATLAS and build matlisp with that if you haven't already. Ray