Discussion:
Say hello to viff.boost
Marcel Keller
2010-08-02 14:10:02 UTC
Permalink
Hi friends of VIFF,

I've implemented Share and ShareList in C, based on a C implementation
of Deferred. Using the C extension, benchmark.py and aes.py show a speed
up between 50 and 100 percent.

The code is in my repository: http://hg.viff.dk/mkeller

To use the extension, first compile and install it:
$ python setup.py install [--prefix PREFIX]

Then, add the following lines two to your program before importing
anything from viff or twisted:

import viff.boost
viff.boost.install(with_viff_reactor=<True|False>)

If the parameter is True, the VIFF reactor is also installed, so this
doesn't have to be done separately.

There is a notable difference to the standard implementation of
Deferred: Errbacks are disabled and exceptions raised in callbacks are
not caught. This is for the following reasons:
- The implementation was inefficient (too many isinstance() calls).
- Errbacks are only used for error reporting in VIFF. However, I prefer
VIFF to crash (and print a traceback) immediately if there is an
exception instead of wrapping the exception and reporting it later,
which makes debugging harder.

I'm open for comments on this issue. It shouldn't be hard to reimplement
errbacks or to implement something different like a global errback. For
compatibility, all Deferred methods are still present.

If trial is modified to load the C extension, all tests succeed except a
few doctests.

Best regards,
Marcel
Mikkel Krøigård
2010-08-02 14:39:11 UTC
Permalink
Post by Marcel Keller
Hi friends of VIFF,
I've implemented Share and ShareList in C, based on a C implementation
of Deferred. Using the C extension, benchmark.py and aes.py show a speed
up between 50 and 100 percent.
This is very nice, but not entirely surprising I think. I believe this
other MPC project that claimed to be much faster than VIFF was also
written in C. There is simply much room for optimization, and you can
probably imagine that having everything written in highly optimized C
code would make it faster still.

Their reasoning, on the other hand, was that the asymptotic nature of
VIFF was causing it to be slower. I am still not convinced about that.
Post by Marcel Keller
The code is in my repository: http://hg.viff.dk/mkeller
$ python setup.py install [--prefix PREFIX]
Then, add the following lines two to your program before importing
import viff.boost
viff.boost.install(with_viff_reactor=<True|False>)
If the parameter is True, the VIFF reactor is also installed, so this
doesn't have to be done separately.
There is a notable difference to the standard implementation of
Deferred: Errbacks are disabled and exceptions raised in callbacks are
- The implementation was inefficient (too many isinstance() calls).
- Errbacks are only used for error reporting in VIFF. However, I prefer
VIFF to crash (and print a traceback) immediately if there is an
exception instead of wrapping the exception and reporting it later,
which makes debugging harder.
Honestly I would too. That said, I haven't really been debugging VIFF
so who am I to argue :)
Post by Marcel Keller
I'm open for comments on this issue. It shouldn't be hard to reimplement
errbacks or to implement something different like a global errback. For
compatibility, all Deferred methods are still present.
If trial is modified to load the C extension, all tests succeed except a
few doctests.
Best regards,
Marcel
_______________________________________________
viff-devel mailing list (http://viff.dk/)
http://lists.viff.dk/listinfo.cgi/viff-devel-viff.dk
Jonathan Van den Schrieck
2010-08-05 16:30:02 UTC
Permalink
Hello,

For my master thesis at UCLouvain (www.uclouvain.be), I wrote a VIFF application for mental poker.
Both files are in the .zip that can be found at http://www.jovds.be/viff_mental_poker.zip
Usage is : python mental_poker.py [player_config_file] [number_of_players] [threshold]

This simulates the shuffling and the dealing of the cards to the players. Both Active and Passive runtimes can obviously be used. To get an idea of the performances, for a 10 players games with threshold 3 and Active Runtime, it takes less than 20 seconds on a single core of an Intel Q6600 (2.4ghz) (one computer per player). Each player has to send 250 KB of data (headers included).

I will soon post my thesis, I first need to write some extra's in it.

I hope maybe this could be a nice demo to illustrate the power of VIFF.

I would also like to thank everyone here for their help, and wish good luck in the future development of VIFF.

Best regards,

Jonathan Van den Schrieck
Marcel Keller
2010-08-11 18:35:07 UTC
Permalink
Hi friends of VIFF,

my repository now also features a C implementation of viff.field. It
uses GMP in GFElement. The benchmarks show a speed up between 100 and
over 200 percent (the latter in multiplication triple generation with
hyperinvertible matrices). The instructions to use it are the same.

Best regards,
Marcel
Post by Marcel Keller
Hi friends of VIFF,
I've implemented Share and ShareList in C, based on a C implementation
of Deferred. Using the C extension, benchmark.py and aes.py show a speed
up between 50 and 100 percent.
The code is in my repository: http://hg.viff.dk/mkeller
$ python setup.py install [--prefix PREFIX]
Then, add the following lines two to your program before importing
import viff.boost
viff.boost.install(with_viff_reactor=<True|False>)
If the parameter is True, the VIFF reactor is also installed, so this
doesn't have to be done separately.
There is a notable difference to the standard implementation of
Deferred: Errbacks are disabled and exceptions raised in callbacks are
- The implementation was inefficient (too many isinstance() calls).
- Errbacks are only used for error reporting in VIFF. However, I prefer
VIFF to crash (and print a traceback) immediately if there is an
exception instead of wrapping the exception and reporting it later,
which makes debugging harder.
I'm open for comments on this issue. It shouldn't be hard to reimplement
errbacks or to implement something different like a global errback. For
compatibility, all Deferred methods are still present.
If trial is modified to load the C extension, all tests succeed except a
few doctests.
Best regards,
Marcel
_______________________________________________
viff-devel mailing list (http://viff.dk/)
http://lists.viff.dk/listinfo.cgi/viff-devel-viff.dk
Loading...