Open Isweet opened 2 years ago
I'll try to answer this more exhaustively later.
A short answer is: A high level of abstraction definitely comes with a cost. That's why we advise to use SIMD operations where possible, which run one operation on many elements, as one gate. For that, you would input vectors instead of single elements and do operations as if on a single element.
GCs are often faster than GMW but that's likely not the main problem here.
What also may help is the use of other memory allocators (e.g., see how MOTION_USE_TCMALLOC is used in the docker script).
Maybe trivial but better double-check that you compiled in Release
.
Did you try to optimize your code @Isweet? If yes, how much faster did it get for you?
Also, I know that the code vectorization is a little annoying because the developer needs to do more than just writing the usual code, so we are working on automating the vectorization. If you're interested, keep an eye on this repo.
Hey,
Apologies for the long issue. We are using MOTION in research that we are getting ready to publish and we don't want to misrepresent MOTION.
I wonder what your experience is with the execution time of MOTION using Boolean GMW to execute arithmetic operations? For example, I wrote the following small benchmark which computes Hamming distance. Am I doing anything incorrectly which would significantly slow things down?
A rough measurement of this program with two parties (hardcoded), on an input size of
1000
, gives an end-to-end execution time of about 8 seconds. I am running a 2019 Intel MacBook Pro w/ 16g of physical RAM. It was run locally, so the network latency is very low (RTT tolocalhost
appears to be about 50 microseconds). I was also careful to ensure that the two MOTION processes did not cause exhaustion of physical RAM.For a comparison, I ran the same benchmark with an input size of
10000
using EMP'ssh2pc
library and the elapsed time is about 1 second.I should mention that I'm aware there are ways to improve this particular benchmark. I'm only using this as a representative example of how we are using MOTION to do arithmetic, etc. We have some benchmarks that will only work with Boolean GMW, and require arithmetic. So, using conversions to Arithmetic GMW and/or using Boolean operations are not an option.
Does this agree with your expectation? Obviously, there are a lot of differences between using MOTION w/ Boolean GMW and EMP w/ Boolean Yao. But, this is a larger difference (8x slower on an input size which is 1 order of magnitude smaller) than I expected.
My understanding of the main performance concerns when comparing these two frameworks are...
Does that sound right?