apache / incubator-teaclave-sgx-sdk

Apache Teaclave (incubating) SGX SDK helps developers to write Intel SGX applications in the Rust programming language, and also known as Rust SGX SDK.
https://teaclave.apache.org
Apache License 2.0
1.17k stars 262 forks source link

Benchmarking / Profiling Recommendations #330

Closed LeibnizCapital closed 3 years ago

LeibnizCapital commented 3 years ago

Any recommendation for running microbenchmarks in the enclave? I cannot naively use libtest bench or criterion as normal. I'm simply looking for general guidance or examples of good benchmarks.

jvz commented 3 years ago

Benchmarking might be complicated here as many use cases should use constant-time algorithms to avoid side channel information leakage. Are you looking for benchmarks of individual operations? I'd be interested in how that could work here as well.

LeibnizCapital commented 3 years ago

I'm interested in benchmarking critical operations (microbenchmarking), like a unit tests as benchmarks. In untrusted land, the libtest bencher has a harness for this.

dingelish commented 3 years ago

hi @LeibnizCapital ,

we have some benchmark results in our CCS'19 paper: https://dingelish.com/ccs19.pdf . section 7 testing code is at https://github.com/mesalock-linux/rust-sgx-benchmark

LeibnizCapital commented 3 years ago

This is helpful @dingelish Since you've wrote these benchmarks, I'll cut to the chase... Do you have recommendations for large key/value store? I see the hugemem and db-proxy examples and some kv crates in third-party. I'm both afraid of abusing encrypted memory and making too many external calls. I'd like to better understand what the tradeoffs are to select the best approach.