- 
                Notifications
    You must be signed in to change notification settings 
- Fork 11
Add evp_hash perftool #58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| Don't print averages.. print "I did XXXXXXX operagtions in XXXXX seconds" | 
| 
 or even "did XXXXXX operations with api in time. basically, don't "distill" the output. print out exactly what you're doing. | 
| 
 github mangled my comment. I hate it Do XXXX operaions of type foo using the bar api in XXXX seconds. | 
| 
 But I think we might need to keep printing of averages for  | 
| 
 @bob-beck How the test works is that it runs threads for 5 seconds and averages the result. So if there's multiple threads, maybe something like this? $ ./evp_hash 10 SHA512 3 # 10 update iterations, 3 threads
Runtime: 5 seconds | Update iterations: 10
Thread 1: XXXX SHA512 hash operations using the EVP API
Thread 2: XXXX SHA512 hash operations using the EVP API
Thread 3: XXXX SHA512 hash operations using the EVP API
Average time per hash: 12.430825us@Sashan and yes, I'll keep the  | 
| That's correct. -t flag is useful for automation, please implement it for each test. | 
8f59d38    to
    5d3aae4      
    Compare
  
    | 
 sure, and total at the end (after stopping timing) | 
| 
 Is there any reason why you don't know beforehand? I.e. You tell it to do 100000 operations. if it splits it up evenly, meh. | 
| 
 Just a note: that's not 100% true, because the tests are run until we pass the 5s margin and that might be by any amount time is needed to get to the while cycle condition | 
| 
 I would not introduce yet another output for threaded operations. @esyr had some good ideas in his #50. | 
| 
 5 seconds seems like a very short time. it would certainly be better to have the ability to specify the number of operations to perform. This makes it much easier to compare impact on different types of machines, etc. because you can do the same amount of work and measuer the time difference. | 
| 
 We had it like that, then there was a decision to rework to this model for some reason | 
| 
 | 
        
          
                source/evp_hash.c
              
                Outdated
          
        
      | #include <stdio.h> | ||
| #ifndef _WIN32 | ||
| # include <unistd.h> | ||
| # include <libgen.h> | 
      
        
              This comment was marked as resolved.
        
          
      
    
    This comment was marked as resolved.
Sorry, something went wrong.
| I've updated the program to work slightly differently. @bob-beck wanted an option to compare performance of EVP API when you had the option to have shared data between threads or not. $ ./evp_hash -h
Usage: evp_hash [-h] [-t] [-o operation] [-u update-times] [-a algorithm] thread-count
-h - print this help output
-t - terse output
-o operation - mode of operation. One of [deprecated, evp_isolated, evp_shared] (default: evp_shared)
-u update-times - times to update digest. 1 for one-shot (default: 1)
-a algorithm - One of: [SHA1, SHA224, SHA256, SHA384, SHA512] (default: SHA1)
thread-count - number of threads
$ ./evp_hash -o deprecated -a SHA256 1000 # deprecated API, SHA256 hash algorithm, 1000 threads
Average time per hash: 48.245043us
$ ./evp_hash -o evp_shared -a SHA256 1000 # EVP API, shared
Average time per hash: 53.653964us
$ ./evp_hash -o evp_isolated -a SHA256 1000 # EVP API, isolated
Average time per hash: 485.848308us | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me. thanks.
one-shot and SHA1 by default
Instead of just choosing between deprecated and EVP API, choose one of [deprecated, evp_isolated, evp_shared] (default: evp_shared)
Adds a CLI tool that computes hashes using the specified algorithm. Prints out the average time per hash computation after 5 seconds. The tool uses the EVP API by default, but this tool can also use the corresponding deprecated API's. The currently supported algorithms are as follows: SHA1, SHA224, SHA256, SHA384, SHA512. Fixes: openssl/project#1681 Reviewed-by: Neil Horman <[email protected]> Reviewed-by: Saša Nedvědický <[email protected]> (Merged from #58)
| merged in as 3eb9e61 | 
Adds a CLI tool that computes hashes using the specified algorithm. Prints out the average time per hash computation after 5 seconds.
Features:
Example:
Fixes openssl/project#1681