Hi, some experiences.
I moved from Vista 32 to Windows 7 64 during Easter. I have a Q6700
PC.
Three issues are maybe of general interest.
1) Virtualbox 4.3.4: A clumsy environment so I switched back to (the
new) VMware player 3.01 and (the old) Sage 4.1. Now I was positively
surprised how cool Sage works, and also the fact that I could run
multiple Sage sessions all calculating ... But maybe my Virtualbox
isn't properly installed?
2) I hoped for a considerable increase in speed, because 64bit
optimized c code or assembly instructions are superior to 32bit. So I
tested a few simple operations, and I noticed hardly any improvement!
Did I installed the wrong version of Sage 4.1? I used sage-
vmware-4.1.7z.
3) Whilst looking for "need for speed", I found that many relatively
simple standard sage functions aren't optimized. For instance
CRT_list(v,moduli)?? states:
if len(v) == 0:
return 0
x = v[0]
m = moduli[0]
for i in range(1,len(v)):
x = CRT(x,v[i],m,moduli[i])
m *= moduli[i]
return x%m
And CRT(a,b,m,n)??:
if isinstance(a,list):
return CRT_list(a,b)
g, alpha, beta = XGCD(m,n)
if g != 1:
raise ValueError, "arguments a and b must be coprime"
return a+(b-a)*alpha*m
Just combining both gives:
def crt_faster(v,moduli):
x = v[0]
m = moduli[0]
for i in range(1,len(v)):
x +=(v[i]-x)*xgcd(m,moduli[i])[1]*m
m *= moduli[i]
return x%m
This improves speed by a factor of 1.5 to 2.
- Is there in the near future an effort to optimize those relatively
simple, but probably often used, routines?
- What is the best way to check the most efficient routine? Installing
packages like FLINT?
Roland
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org