Closed siberianhuskies closed 2 years ago
This is because private outputs require masks that are generated in batches. The default batch size is 10000, which is a considerable cost compared to the rest. You can reduce with the -b
argument to the virtual machines.
OK, thanks. Setting -b 3
yields indeed the expected behavior. Now reveal_to(i)
is much faster and Timer4 takes only 0.0003 seconds.
Hi, I'm not sure if I'm doing or understanding something wrong, but it seems like
reveal_to(id)
is very slow compared toreveal()
.If have the following simple example:
I used semi-honest Shamir's secret sharing, and the corrsponding timeing values with three parties are:
(The timings are even worse for more parties)
The example first reads some input (1), then an additional hiding value (2), adds the hiding value to the input and reveals that result to all parties (3), and outputs a single entry of the state to each party (4).
Running only (1) and (4), or only (1), (2) and (3) yields roughly the same measured times of each Timer1-4. Executing (1)+(2)+(3) takes roughly 0.006 seconds, whereas executing only (1)+(4) takes roughly 0.012 seconds.
Obviously the output based on
reveal_to(i)
(Timer4) is magnitudes slower than "reading an additional value, use it to hide the state, and then output the complete state" (Timer2+Timer3, but same security). I would have assumed option (4) should be faster, than (2)+(3).Also, even if adding
out_hidden[i].reveal().raw_output()
in the loop of (3) assuming maybe the writing to the file takes so much time, only increases the time marginally.Am I doing something wrong? Or can you please explain if this is expected behavior.