On Thu, Jan 15, 2009 at 4:21 PM, Robert Bradshaw
<[email protected]> wrote:
>
> On Jan 15, 2009, at 4:10 PM, [email protected] wrote:
>
>> That's interesting because I calculated M37 = 2^3021377-1 (909526
>> digits) on a 2.6 GHz pentium 4 using my own C++ class to represent
>> large ints and it about 2 hours.
>>
>> I calculated the same thing on www.sagenb.org and it took about 6
>> minutes!
>
> Yeah, sagenb.org can get pretty loaded down some times.
He was saying that "6 minutes" was very very fast, not slow. [[his
timing turns
out to really have been of printing out the answer via the notebook.
better would be to do
sage: time s = 2^3021377-1
CPU time: 0.00 s, Wall time: 0.00 s
sage: time open('output.txt','w').write(str(s))
CPU time: 0.70 s, Wall time: 0.70 s
which gives a link to a file that you can download that contains the answer.]]
By the way, I've never actually seen sagenb.org according to top be
heavily bogged down. When I moved it to the virtual server I set it
so processes automatically terminate if they exceed 1GB or 1 hour or
spawn more than 400 processes. By the way, I'll move sagenb.org from
my desktop
> This is on my
> laptop (2.33 GHz Intel Core 2 Duo)
>
> sage: time M37 = 2^3021377-1
> CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
> Wall time: 0.00 s
> sage: time len(str(M37))
> CPU times: user 1.06 s, sys: 0.03 s, total: 1.08 s
> Wall time: 1.09 s
> 909526
>
> Note that the bulk of the time is spent getting the (decimal) string
> representation of M37. Of course, if I only wanted the number of
> digits, I could more quickly do
>
> sage: time RIF(M37).log(10)
> CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
> Wall time: 0.00 s
> 909525.1052092525?
>
> I wonder if doing this via the notebook took so long because of the
> overhead of sending the data back (most browsers don't do well with
> nearly a MB of text in a cell...). Sage uses gmp in the background to
> do it's big integer arithmetic and is both very tightly coded and has
> a wide range of asymptotically fast algorithms, which shouldn't
> impact this case, but for another example:
>
> sage: time a = M37^2
> CPU times: user 0.09 s, sys: 0.01 s, total: 0.10 s
> Wall time: 0.10 s
>
>> Well, I suppose 4 Xeon cores is a mini cluster of sorts.
>
> Yeah, it's not bad for a desktop :).
>
> - Robert
>
>
> >
>
--
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-edu" group.
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-edu?hl=en
-~----------~----~----~----~------~----~------~--~---