DemesneGH commented on issue #89:
URL: 
https://github.com/apache/incubator-teaclave-trustzone-sdk/issues/89#issuecomment-1246349122

   hi @syedelec 
   I made the performance comparison between C TAs and Rust TAs, on `random` 
and `aes`:
   ```
   # time ./random-rs
   Invoking TA to generate random UUID...
   Invoking done!
   Generate random UUID: 918585d0-6be4-4d7-e09dcb5e4387c79b
   Success
   real 0m 0.46s
   user 0m 0.07s
   sys  0m 0.24s
   
   # time optee_example_random
   Invoking TA to generate random UUID...
   TA generated UUID value = 0xad36b1d0f8134f8ae2cb4a14bf11813d
   real 0m 0.34s
   user 0m 0.06s
   sys  0m 0.19s
   ```
   
   ```
   # time ./aes-rs
   Prepare encode operation
   Load key in TA
   Reset ciphering operation in TA (provides the initial vector)
   Encode buffer from TA
   Prepare decode operation
   Load key in TA
   Reset ciphering operation in TA (provides the initial vector)
   Decode buffer from TA
   Clear text and decoded text match
   real 0m 0.56s
   user 0m 0.11s
   sys  0m 0.28s
   
   # time optee_example_aes
   Prepare session with the TA
   Prepare encode operation
   Load key in TA
   Reset ciphering operation in TA (provides the initial vector)
   Encode buffer from TA
   Prepare decode operation
   Load key in TA
   Reset ciphering operation in TA (provides the initial vector)
   Decode buffer from TA
   Clear text and decoded text match
   real 0m 0.39s
   user 0m 0.07s
   sys  0m 0.21s
   ```
   
   Yes, Rust TAs has lower performance (about 35%) than C TAs  on my 
environment (QEMUv8 & OP-TEE 3.17.0).
   
   For performance optimization you can find some guidance on the [Cargo 
documentation](https://doc.rust-lang.org/cargo/reference/profiles.html). 
Possible workarounds are using higher `opt-level`, disabling some runtime 
checks, etc.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@teaclave.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@teaclave.apache.org
For additional commands, e-mail: dev-h...@teaclave.apache.org

Reply via email to