bvibber / mtpng

A parallelized PNG encoder in Rust
https://crates.io/crates/mtpng
Other
211 stars 12 forks source link

Windows build is slower than Linux build #3

Open bvibber opened 6 years ago

bvibber commented 6 years ago

Win64 and win32 builds of mtpng are noticeably slower than Linux or macOS builds, more so than when running the Linux build on WSL.

It looks like it may be due to using zlib via the libz_sys crate, which compiles locally on Windows while picking up a highly-optimized system package on Linux. The local compile may not pick up the best optimization options, and definitely doesn't engage the specialized assembly functions that are available.

bvibber commented 6 years ago

Using the vcpkg version of zlib seems to help a little. To use it, set up vcpkg and add this env var in PowerShell:

$env:VCPKGRS_DYNAMIC = "1"

(note this pulls it in as a .dll)

However that still seems to not be using the assembly optimizations? Manually built the .dll from source and dropped it in and it's closer still: