The guys from Gemstone describe maglev as:

MagLev /măg-lĕv/ n. a fast, stable, Ruby implementation with integrated object >persistence and distributed shared cache.

Outside of computer science, "MagLev" usually stands for "magnetic levitation" as employed by some monorail trains.

Today I noticed the the announcement on their googlegroup, for the release of a public alpha.
Installing it isn't all that hard (on Linux at least). Just download the installer, extract it and running the installer:

./installMaglev.sh 22578

This will tell the installer to fetch version 22578 (the current version as I write this according to their github repo) and extract it. This will extract "gemstone" and "maglev" to the installer directory.
Gemstone is a distributed object persistence server initially developed for smalltalk, maglev is their Ruby vm.
After that, you can decide where to move those two directories and simply add the following environment variables

export MAGLEV_HOME=/whereever/you/copied/it/
export PATH=$MAGLEV_HOME/bin:$PATH

after you've done this, you should be ready to go. Just start up the maglev server using:

maglev start

and you can start using the following commands:

  • maglev: start and stop the server
  • maglev-gem: install gems for maglev
  • maglev-irb: interactive maglev shell
  • maglev-ruby: execute ruby scripts

Seeing as there is the first public alpha release of maglev I decided to look at the speed of it all. I still had some computation intensive things:
uebung2.rb is a simple Diffie-Hellmann key exchange ( g = 7789, p = 1017473. Alice‚Äôs Secret Key α is 415492 and Bob‚Äôs Secret Key β 725193.)
uebung3a.rb is a (3 person) group key exchange according to Ingemarsson, Tang and Wong.
uebung3b.rb is a (3 person) group key exchange according to Burmester and Desmet.
I uploaded the sources to this gist

I used the following versions:

$ ruby --version
ruby 1.9.1p243 (2009-07-16 revision 24175) [x86_64-linux]

$ maglev-ruby --version
maglev 0.6 (ruby 1.8.6) (2009-11-20 rev 22578-1067) [x86_64-linux]

Without further ado, here are the numbers:


Uebung 2:
ruby 1.9.1

$ time ruby uebung2.rb
Generator: 7789
Prime: 1017473
[...]
bob's key: 707860
alice's key: 707860

real 0m0.322s
user 0m0.300s
sys 0m0.020s

maglev

$ time maglev-ruby uebung2.rb
Generator: 7789
Prime: 1017473
[...]
bob's key: 707860
alice's key: 707860

real 0m0.726s
user 0m0.250s
sys 0m0.080s


Uebung 3a:
ruby 1.9.1

$ time ruby uebung3a.rb Generator: 7789
Prime: 1017473
[...]
alice's group Key: 470113
bob's group Key: 470113
carol's group Key: 470113

real 0m0.710s
user 0m0.700s
sys 0m0.010s

maglev

$ time maglev-ruby uebung3a.rb
Generator: 7789
Prime: 1017473
[...]
alice's group Key: 470113
bob's group Key: 470113
carol's group Key: 470113

real 0m0.971s
user 0m0.480s
sys 0m0.090s


Uebung 3b:

ruby 1.9.1

$ time ruby uebung3b.rb
Generator: 7789
Prime: 1017473
[...]
ROUND TWO
[...]
GROUPKEY
alice's group Key: 648631
bob's group Key: 648631
carol's group Key: 648631

real 0m1.159s
user 0m1.130s
sys 0m0.020s

maglev

$ time maglev-ruby uebung3b.rb

Generator: 7789
Prime: 1017473
[...]
ROUND TWO
[...]
GROUPKEY
alice's group Key: 648631
bob's group Key: 648631
carol's group Key: 648631

real 0m1.262s
user 0m0.770s
sys 0m0.080s


I'd say that's a pretty good start :)
A good explenation what "real", "user" and "sys" mean can be found on stackoverflow, here's the quote:

Real is wall clock time - time from start to finish of the call. This is all elapsed time including time slices used by other processes and time the process spends blocked (for example if it is waiting for I/O to complete).

User is the amount of CPU time spent in user-mode code (outside the kernel) within the process. This is only actual CPU time used in executing the process. Other processes and time the process spends blocked do not count towards this figure.

Sys is the amount of CPU time spent in the kernel within the process. This means executing CPU time spent in system calls within the kernel, as opposed to library code, which is still running in user-space. Like 'user', this is only CPU time used by the process

Here are some more links:
the rdoc
the official homepage
the maglev github repo

Comments