Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Carlton_S_
Beginner
71 Views

Performance Increase Inside Enclave

Hello,

I am a university researcher conducting research on secure sensor data processing.  We've implemented some of our (mathematically-intensive) algorithms inside an enclave (compiled with the provided Intel Compiler and trusted Intel std. C/C++ library) and compared this against non-enclave performance (compiled with Microsoft Visual C++ Compiler w/Microsoft's std. libs).

We're seeing substantial performance increases with the SGX implementation (typically >10x increases).

We had informal discussions with an Intel rep. approximately 12 months ago, who stated that the Intel C/C++ libs are optimised with IPP, which benefits floating-point and string-based operations (which we rely upon hugely).

Is this correct, and would it be possible for someone to elaborate on this?  Finally, what would be the best way to 'equalise' this performance (e.g. analgous to using the SGX libs in the untrusted implementation), so we can gauge the overhead of SGX more accurately?

Hope someone can help.

Best wishes,
Carlton

EDIT: Specifically, we heavily use vector data structures (including matrices implemented as vector<vector<float>>), floating point math (primarily multiplication and exponentiation, including roots) and string manipulation (atoi, strtok and strdup).

0 Kudos
3 Replies
Juan_d_Intel
Employee
71 Views

On Windows, sgx_tstdc.lib is linked with the Intel optimized math, string and cryptography libraries.

To compare performance, I'd first suggest you compare running an enclave in HW mode vs. running in Simulation. Note that you have to change the Simulation settings, since compiler optimizations are turned off. To ensure you have the same compiler settings, you may create a new building profile based on Prerelease and change the linker libraries to use the Simulation ones.

 

Ofir_W_
Beginner
71 Views

 

Hello,

I can think of a few possible suspects: 

  1. Unoptimized math functions in SGX SDK.
  2. Your program memory footprint is larger than ~90MB, causing many page faults which may be devastating for performance.
  3. Your program performs many ocalls during execution. If you have more than 20,000 ocalls per second, this will become an issue.
  4. Your program is memory intensive, using encrypted memory incur performances overhead. In general, consecutive accesses are better than sparse accesses.

 

Ofir

Ishai_N_Intel
Employee
71 Views

Instead of changing the SGX implementation, you can change your regular implementation and use Intel compiler and libraries.
There are free packages for academy usage.

https://software.intel.com/en-us/qualify-for-free-software

Reply