For comparision, I'm using kvm to virtualize our sage notebook server.
Here's the timings for your scripts:

A) the real hardware

0.196608066559
1

0.191864967346
-500000

B) the kvm instance

0.219820976257 (11.8% slowdown)
1

0.213951826096 (11.5% slowdown)
-500000

Gonzalo

On Fri, Oct 23, 2009 at 7:38 PM, Ondrej Certik <ond...@certik.cz> wrote:
>
> Hi,
>
> I tried the latest Sage virtualbox appliance, it works on ubuntu 9.04, 64bit.
>
> I then used this simple script (in a terminal) to get some idea how fast it 
> is:
>
> from timeit  import default_timer as clock
> def test1():
>    a = 0
>    t = clock()
>    for i in range(1, 10**6):
>        a += 1/i**2
>    t = clock() - t
>    print t
>    return a
>
> print test1()
>
>
> and then test it on my system:
>
> $ python2.5 t.py
> 0.198249101639
> 1
>
>
> and in the virtualbox:
>
> # python a.py
> 2.60369110107
>
> E.g. it's about 13x slower.
>
> For comparison, in the virtual machine at linode.com, I get:
>
> $ python t.py
> 0.25862288475
> 1
>
> Then it occured to me that maybe just floating point stuff is slow, or
> maybe i**2 is too big. So I modified the script:
>
>
> from timeit  import default_timer as clock
> def test1():
>    a = 0
>    t = clock()
>    for i in range(1, 10**6):
>        if i % 2 == 0:
>            a += i
>        else:
>            a -= i
>    t = clock() - t
>    print t
>    return a
>
> print test1()
>
> which runs on ubuntu:
>
> $ python2.5 t.py
> 0.212127923965
> -500000
>
>
> and in the virtualbox on the same machine:
>
> # python a.py
> 0.267327070236
> -500000
>
>
> Which is only about 1.2x slower. So apparently virtualbox is very fast
> for some things.
>
> Ondrej
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to