Topic: wolfssl.lib - 2Mb in Release mode with Visual Studio 2008?

Hello,

Right after the download of wolfssl-3.9.0, I opened wolfssl.sln with Visual Studio 2008, didn't change anything and compiled.

Release build resulted in wolfssl.lib of 2Mb size!
Strangely, Debug build produced wolfssl.lib of 1.7MB.

When I linked my executable with Release wolfssl.lib, my .exe added 200Kb of size.

From what I read in the forums, the sizes (even without defining features out) should be much smaller.

Any ideas, please?

Share

Re: wolfssl.lib - 2Mb in Release mode with Visual Studio 2008?

Hi,

The default wolfSSL configuration used in the Visual Studio project files has not been optimized for footprint size.  For example, the user_settings.h file used by the VS projects to compile wolfSSL is located at:

<wolfssl_root>/IDE/WIN/user_settings.h

This settings file enables the OpenSSL Compatibility Layer (OPENSSL_EXTRA), RIPEMD (WOLFSSL_RIPEMD), SHA-512 (WOLFSSL_SHA512), and sniffer support (WOLFSSL_SNIFFER).  You can try disabling unneeded features to reduce the library size as needed.

The Visual Studio project files are meant to be a starting place for getting wolfSSL compiled with Visual Studio, where users can then optimize for performance, size, or features from there.

Do you mind if I ask what kind of project you are working on?

Thanks,
Chris

Re: wolfssl.lib - 2Mb in Release mode with Visual Studio 2008?

Chris,

Thanks a lot for such a detailed and well written answers. Such a pleasure to read!

We are working on a video streaming application where web-based secure websockets (wss)
receive video chunks from our server. So we are adding the wolfSSL to our server.
As said before, we are using callbacks for reading and writing, and trying to avoid any extra copying of data,
so being able to send out straight from your output buffer is very important.

So far it works very well, but we need to test for performance, memory leaks, etc..., with multiple concurrrent websocket sessions. Our server runs on Windows, but still we want the minimal impact on the binary size.

Share

Re: wolfssl.lib - 2Mb in Release mode with Visual Studio 2008?

Hi,

Thanks for the additional info on your project, and glad to help out.

Going back to the library size, you were compiling the static wolfSSL library (.lib), which most likely was also pulling in some OS-level stuff when linking.  If you were to switch and compile the wolfSSL DLL instead of the static library, you would see a footprint size more closely aligned with your 200-300kB number.

Best Regards,
Chris