On Sun, Nov 30, 2008 at 12:50 PM, mabshoff <[EMAIL PROTECTED]> wrote: > > > > On Nov 30, 12:40 pm, "William Stein" <[EMAIL PROTECTED]> wrote: >> On Sun, Nov 30, 2008 at 12:37 PM, Martin Albrecht >> >> >> >> <[EMAIL PROTECTED]> wrote: >> >> >> Here's another example: >> >> 64-bit: >> >> sage: time a = random_matrix(ZZ,200).determinant() >> >> CPU times: user 2.74 s, sys: 0.01 s, total: 2.75 s >> >> >> 32-bit: >> >> sage: time a = random_matrix(ZZ,200).determinant() >> >> CPU times: user 0.74 s, sys: 0.04 s, total: 0.78 s >> >> >> Here, surprisingly, 64-bit is WAY SLOWER than 32-bit at doing the >> >> exact same thing. I don't really understand this. The moral should I >> >> think be that 32 versus 64 bit can be really subtle when it comes to >> >> performance. >> >> > It seems to me that this should be considered a bug. > > Well, I would guess that one of the above was run under virtualization > or am I wrong? >
Both were. Then I retested the slower 64-bit one on sage.math and it was still way slower there. >> I don't think "bug" is the right word -- however, fixing this or giving a >> good >> explanation should be considered an "Enhancement". >> >> I'm surprised about the speed difference. It's very likely in either IML >> or Linbox. > > Speed differences where 32 bit code is faster than 64 bit code are > most commonly caused by code that manipulates a lot of pointers. But > the speed difference should usually be only a factor of up to two and > I am sure the above code does not do 100% pointer manipulation. One > explanation for the observed difference could be cache foot print, > i.e. code + data in the 32 bit case fit the L1 or L2 "better" than the > 64 bit version. Note that 64 bit binaries are also fatter than their > 32 bit counterpart. At least on x86-64 CPUs the larger number of > registers should compensate for the pointer issues. > > What to do? Let's try something larger than 200x200 to see if the > cache is involved or not. > >> William > > Cheers, > > Michael > > > -- William Stein Associate Professor of Mathematics University of Washington http://wstein.org --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---