simdjson: MSVC simdjson twice as slow as ClangCL

On Windows, simdjson compiled with MSVC parses twitter.json at almost half the speed of ClangCL-compiled simdjson, on the same machine, in the same command prompt.

Platform Overall Stage 1 Stage 2
MSVC 19.25.28614 1.3051 2.3777 3.3898
ClangCL 9.0.0 2.2221 5.4161 4.6401

Methodology:

  • MSVC: git clean -ffdx build && cmake -B build && cmake --build build --target parse --config Release && build\benchmark\Release\parse jsonexamples\twitter.json
  • ClangCL: git clean -ffdx build && cmake -B build -T ClangCL && cmake --build build --target parse --config Release && build\benchmark\Release\parse jsonexamples\twitter.json

I validated that MSVC simdjson is using the haswell implementation, both by running json2json to print out the implementation, and by doing set SIMDJSON_FORCE_IMPLEMENTATION=haswell.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 64 (56 by maintainers)

Most upvoted comments

So, we looked into it, and it turns out the issue is that having an intrinsic in a loop actually causes our loop unroller to bail out. So that’s not great. We’ll get it fixed.

Compiling simdjson with GNU GCC (MinGW 64-bit) under Windows seems to give good performance that is on par with Linux. I am achieving 2.8 GB/s on twitter.json.

Here is a screenshot proof…

Screen Shot 2020-06-29 at 9 35 33 PM

So it is not Linux holding us back. There is really something bad for us in the Visual Studio backend.

Hmmm…

cc @jkeiser @eddelbuettel