aklomp / base64

Fast Base64 stream encoder/decoder in C99, with SIMD acceleration
BSD 2-Clause "Simplified" License
884 stars 165 forks source link

Added MSVC 2013 support; Proper check of CPU's AVX2 feature support #3

Closed zenden2k closed 9 years ago

zenden2k commented 9 years ago

Added Visual Studio solution. Tests passed. Could not run AVX2 test on unix because VirtualBox has no support for AVX instructions.

screenshot 2015-09-04 001.png

windows:

AVX2    encode  2252.10 MB/sec
AVX2    decode  3267.33 MB/sec
plain   encode  617.23 MB/sec
plain   decode  672.57 MB/sec
SSSE3   encode  2010.86 MB/sec
SSSE3   decode  2603.15 MB/sec

linux (vb):

plain   encode  1626.93 MB/sec
plain   decode  1469.71 MB/sec
SSSE3   encode  2203.48 MB/sec
SSSE3   decode  2683.54 MB/sec
aklomp commented 9 years ago

Hi, thanks for contributing! I tested the AVX2 support under Linux on a CPU with hardware support and it passes fine.

So, Windows support, eh :) I'm willing to work with you to integrate support for MSVC, but since I don't run Windows and have never worked with MSVC, I can't really update or test the MSVC code myself. Such "black box" code which the author cannot verify may be a problem if/when this library is extended in the future. But I don't think that outweighs the benefits of wider platform support.

I've taken a quick look at your pull request, and though it looks functionally OK, there are some issues that prevent me from merging it as-is. One of them is that all changes are rolled into one big commit. Would it be possible to split the commits up into smaller chunks like this:

That would make it easier to review the changes and isolate the locations which need porting work whenever the library changes.

Then there are some clarity/stylistic issues, which I will add as notes into your pull request. That might take me some time (over the weekend), though.

aklomp commented 9 years ago

Hey, are you still interested in contributing an MSVC port? Most of the setup work is in place now.

zenden2k commented 9 years ago

Yes is just am thinking about using CMake instead of Visual Studio soluition.

aklomp commented 9 years ago

Interesting! I wish I could help, but I don't have any experience with CMake. I like the idea though.