I'm not sure how the official benchmarks were generated, but Wei Dai sent them to me a while ago. Full benchmarks for version 5.6.0: http://www.cryptopp.com/benchmarks.html
<http://www.cryptopp.com/benchmarks.html>The results I got using my little test app were run under similar OS conditions. The app basically encrypts and decrypts 1.5mb of text ( actually it was 2016 bytes by the time I got these results, but then I changed it to 1.5mb ), 200000 times, and measures the time it takes to do that ( this time does _not_ include set up time ). I compiled it against both versions, 5.5.2 and 5.6.0, and then ran it on my system. I just removed the dynamic_cast check, compiled against the library and then my test app, and got better results, but still not as good as the ones I get with version 5.5.2. *v5.6.0 without dynamic_cast (lib modified)* 128-bit key: 11, 12, 11, 11, 11 secs 256-bit key: 13, 13, 13, 12, 13 secs *v5.5.2* 128-bit key: 11, 10, 10, 11, 10 secs 256-bit key: 12, 12, 12, 12, 12 secs As you can see, version 5.5.2 still performs better. Walt. On Tue, Jan 26, 2010 at 7:25 AM, Chris Morgan <[email protected]> wrote: > Ahh, it wasn't obvious that your results differed, I thought you generated > the chart. > > How were the original numbers generated? If they come from an app inside of > cryptopp then are the input parameters close to the same? Same input buffer > sizes etc? What happens if you run on your system the app that generated the > claimed results? > > You would have to look to see if that dynamic cast could be removed. Adding > a print message there, or a breakpoint under a debugger, would let you see > if that code path was taken. I don't know if rtti is necessary for other c++ > operations other than the dynamic cast. > > Chris > > > > > On Jan 26, 2010, at 10:11 AM, Walter Villalba <[email protected]> wrote: > > Hi Chris, > > Thanks a lot for your response. Whether or not RTTI can be disabled is > one of the questions. There's only one usage of dynamic_cast in version > 5.6.0 of the library. I am not able to run my little test app if I don't > enable RTTI for it ( regardless of enabling RTTI or not when I compile the > library. Weird. ) > > The results don't look good at all, that's why I'm concerned. The image I > sent are the official benchmarks, and they show AES performance was improved > in version 5.6.0, but the results I'm getting do _not_ show this. Quote > from my previous email: > > *128-bit key* >> Release-v5.5.2-PPro-NoRTTI >> 16 / 16 / 16 / 16 / 16 >> Release-v5.5.2-PPro-RTTI >> 16 / 16 / 16 / 16 / 15 >> Release-v5.6.0-PPro-NoRTTI >> "Access violation - no RTTI data!" error >> Release-v5.6.0-PPro-RTTI >> 18 / 18 / 18 / 18 / 19 >> >> *256-bit key* >> Release-v5.5.2-PPro-NoRTTI >> 17 / 18 / 17 / 17 / 18 secs >> Release-v5.5.2-PPro-RTTI >> 18 / 18 / 18 / 18 / 17 secs >> Release-v5.6.0-PPro-NoRTTI >> "Access violation - no RTTI data!" error >> Release-v5.6.0-PPro-RTTI >> 21 / 21 / 20 / 21 / 21 secs >> > For instance, AES 128-bit using version 5.5.2 takes 16 secs, and the same > app compiled using version 5.6.0 takes 18. The source code was included in > my first email. > > So AES seems to perform better in version 5.5.2 than in version 5.6.0, > exactly the opposite as expected. > > Any ideas ? Again, thanks a lot. > > Walt. > > > On Tue, Jan 26, 2010 at 6:56 AM, Chris Morgan < <[email protected]> > [email protected]> wrote: > >> Is the question whether or not Rtti can be disabled? If there are any >> dynamic casts then probably not. You could always try to disable it and see >> if things run :-) >> >> Otherwise the results look good, significant improvement between 5.5.2 and >> 5.6. >> >> Chris >> >> >> >> On Jan 26, 2010, at 9:35 AM, Walter Villalba < <[email protected]> >> [email protected]> wrote: >> >> Anyone ? >> >> On Wed, Jan 20, 2010 at 1:22 PM, Walter Villalba < >> <[email protected]><[email protected]> >> [email protected]> wrote: >> >>> According to the benchmarks ( from the crypto++ website and archives ), >>> version 5.6.0 has better performance than 5.5.2, when using AES/CFB (see >>> attached image). >>> >>> >> I've been doing some tests and the results I'm getting do not match up >>> with this. I created a small test app which creates a 2016 char >>> std::string, sets up an encryptor and decryptor with key (128 and 256 bit) >>> and then enters an encryption/decryption loop. The app only considers the >>> time the program takes to execute the loop, not the initialization and set >>> up. I'm providing the source code at the end of this email. >>> >>> *Configuration: * >>> * Microsoft Windows XP SP 2 >>> * Microsoft VC6 SP6 >>> >>> I ran the app 5 times for each configuration, under similar conditions. >>> All configs are in release mode, both for my app and the crypto++ library, >>> and optimized for Pentium Pro. The name states the crypto++ library >>> version used, and also if using RTTI or not. >>> >>> Results: >>> >>> *128-bit key* >>> Release-v5.5.2-PPro-NoRTTI >>> 16 / 16 / 16 / 16 / 16 >>> Release-v5.5.2-PPro-RTTI >>> 16 / 16 / 16 / 16 / 15 >>> Release-v5.6.0-PPro-NoRTTI >>> "Access violation - no RTTI data!" error >>> Release-v5.6.0-PPro-RTTI >>> 18 / 18 / 18 / 18 / 19 >>> >>> *256-bit key* >>> Release-v5.5.2-PPro-NoRTTI >>> 17 / 18 / 17 / 17 / 18 secs >>> Release-v5.5.2-PPro-RTTI >>> 18 / 18 / 18 / 18 / 17 secs >>> Release-v5.6.0-PPro-NoRTTI >>> "Access violation - no RTTI data!" error >>> Release-v5.6.0-PPro-RTTI >>> 21 / 21 / 20 / 21 / 21 secs >>> >>> >>> Is there any way to use version 5.6.0 without enabling RTTI ? I've read >>> this implies extra overhead. >>> >>> Thanks a lot, >>> Walt. >>> >>> >>> *Source code:* >>> >>> // Key and IV initialization goes here >>> // Key size is 16 bytes for 128-bit config, 32 bytes for 256-bit config >>> >>> int main(int argc, char* argv[]) >>> { >>> time_t startTime, finishTime; >>> >>> // Message: 2016 chars (bytes) >>> std::string plainText = "123456789123....( I've shortened this string >>> for this email )....6789123456789"; >>> >>> // Debug >>> std::cout << "Plain text: " << plainText << std::endl; >>> std::cout << "Plain text size: " << plainText.size() << " bytes." << >>> std::endl; >>> >>> // Cipher and Recovered text sinks >>> std::string cipherText, recoveredText; >>> >>> // Block cipher: AES >>> // Mode of operation: CFB (Cipher FeedBack) >>> CFB_Mode< AES >::Encryption encryptor; >>> CFB_Mode< AES >::Decryption decryptor; >>> >>> decryptor.SetKeyWithIV( key, sizeof(key), iv ); >>> encryptor.SetKeyWithIV( key, sizeof(key), iv ); >>> >>> // save current time just before starting the encryption/decryption >>> loop >>> time( &startTime ); >>> >>> for ( int i = 0; i < 200000; i++ ) >>> { >>> // clean up for next round >>> cipherText = ""; >>> recoveredText = ""; >>> >>> try { >>> StringSource( plainText, true, >>> new StreamTransformationFilter( encryptor, >>> new StringSink( cipherText ) >>> ) // StreamTransformationFilter >>> ); // StringSource >>> } // end-try >>> catch(CryptoPP::Exception &e) >>> { >>> std::cout << e.what() << std::endl << std::endl; >>> } >>> catch(std::exception &e) >>> { >>> std::cout << e.what() << std::endl << std::endl; >>> } >>> >>> >>> try { >>> StringSource( cipherText, true, >>> new StreamTransformationFilter( decryptor, >>> new StringSink( recoveredText ) >>> ) // StreamTransformationFilter >>> ); // StringSource >>> } // end-try >>> catch(CryptoPP::Exception &e) >>> { >>> std::cout << e.what() << std::endl << std::endl; >>> } >>> catch(std::exception &e) >>> { >>> std::cout << e.what() << std::endl << std::endl; >>> } >>> >>> } // end-for >>> >>> // save current time just after finishing the encryption/decryption >>> loop >>> time( &finishTime ); >>> >>> double executionTimeInSec = difftime( finishTime, startTime ); >>> >>> // Debug >>> //std::cout << "Cipher text: " << cipherText << std::endl; >>> //std::cout << "Cipher text size: " << cipherText.size() << " bytes." >>> << std::endl; >>> >>> // Debug >>> std::cout << "Recovered text: " << recoveredText << std::endl; >>> std::cout << "Recovered text size: " << recoveredText.size() << " >>> bytes." << std::endl; >>> >>> std::cout << "Encryption/decryption loop execution time: " << >>> executionTimeInSec << " seconds." << std::endl; >>> >>> return 0; >>> } >>> >>> ----------------------------------------------- eof. >>> >>> >> -- >> You received this message because you are subscribed to the "Crypto++ >> Users" Google Group. >> To unsubscribe, send an email to >> <[email protected]> >> [email protected]. >> More information about Crypto++ and this group is available at >> <http://www.cryptopp.com> <http://www.cryptopp.com> >> http://www.cryptopp.com. >> >> <CryptoPP-5.5.2-5.6.0-benchmarks.png> >> >> > -- You received this message because you are subscribed to the "Crypto++ Users" Google Group. To unsubscribe, send an email to [email protected]. More information about Crypto++ and this group is available at http://www.cryptopp.com.
