stephenberry / json_performance

Performance profiling of JSON libraries
MIT License
17 stars 11 forks source link

Adding Jsonifier parsing/serializing library. #20

Closed RealTimeChris closed 4 months ago

RealTimeChris commented 5 months ago

As the title says. Let me know if you have any issues with what I've added. Cheers!

stephenberry commented 5 months ago

Thanks for the merge request, I've wanted to add it, but it doesn't build on the latest Apple Clang, which uses Clang 15. Is there a way you could get your code building with Clang 15?

I've also been running these tests on an Arm chip, because I'm concerned about good performance per efficiency. But, I'm afraid that your library won't look as good as it is, because it doesn't support SIMD on Arm.

I do want to add tests on multiple platforms in the future, as I do run tests myself across platforms, but I haven't gotten this codebase to do so automatically.

RealTimeChris commented 5 months ago

It seems to build and run fine on Apple Clang 17: https://github.com/RealTimeChris/Jsonifier/actions/runs/8849780966/job/24302527709 And as for the arm SIMD instructions - let me work on implementing that it shouldn't take me too long.

stephenberry commented 5 months ago

That is the LLVM clang compiler and not Apple clang, which is released with Xcode and only supports Clang 15. I wouldn't be opposed to running Clang 17 on my Arm Mac, but this does mean that your typical Xcode programmer cannot build Jsonifier. I don't think it would be hard to get your code to build with Clang 15, but you would better be able to determine that effort.

And as for the arm SIMD instructions - let me work on implementing that it shouldn't take me too long.

Sounds great.

RealTimeChris commented 5 months ago

Alright I seem to have gotten it to build on Clang 15 as well as having implemented arm-neon simd instructions.

stephenberry commented 5 months ago

Thanks, however I'm getting CMake errors with Jsonifier:

[...]/build/_deps/jsonifier-src/CMake/BuildFeatureTester.sh: line 3: cmake: command not found

CMake Error at build/_deps/jsonifier-src/CMake/JsonifierDetectArchitecture.cmake:40 (math):
  math cannot parse the expression: "No such file or directory": syntax
  error, unexpected end of file (25).
Call Stack (most recent call first):
  build/_deps/jsonifier-src/CMakeLists.txt:57 (include)

CMake Error at build/_deps/jsonifier-src/CMake/JsonifierDetectArchitecture.cmake:52 (math):
  math cannot parse the expression: "( ERROR & 0x1 )": syntax error,
  unexpected exp_AND (9).
Call Stack (most recent call first):
  build/_deps/jsonifier-src/CMakeLists.txt:57 (include)

CMake Error at build/_deps/jsonifier-src/CMake/JsonifierDetectArchitecture.cmake:56 (math):
  math cannot parse the expression: "( ERROR & 0x2 )": syntax error,
  unexpected exp_AND (9).
Call Stack (most recent call first):
  build/_deps/jsonifier-src/CMakeLists.txt:57 (include)
RealTimeChris commented 5 months ago

Man that is strange that it's throwing that error on line 3 of the BuildFeatureTester.sh script.

RealTimeChris commented 5 months ago

What about now? I recently changed some stuff in the Main.cpp that is attempting to be compiled that should have fixed it.

stephenberry commented 5 months ago

I'm still getting the same CMake errors:

Make Error at build/_deps/jsonifier-src/CMake/JsonifierDetectArchitecture.cmake:34 (math):
  math cannot parse the expression: "no such file or directory": syntax
  error, unexpected end of file (25).
Call Stack (most recent call first):
  build/_deps/jsonifier-src/CMakeLists.txt:57 (include)

CMake Error at build/_deps/jsonifier-src/CMake/JsonifierDetectArchitecture.cmake:46 (math):
  math cannot parse the expression: "( ERROR & 0x1 )": syntax error,
  unexpected exp_AND (9).
Call Stack (most recent call first):
  build/_deps/jsonifier-src/CMakeLists.txt:57 (include)

CMake Error at build/_deps/jsonifier-src/CMake/JsonifierDetectArchitecture.cmake:50 (math):
  math cannot parse the expression: "( ERROR & 0x2 )": syntax error,
  unexpected exp_AND (9).
Call Stack (most recent call first):
  build/_deps/jsonifier-src/CMakeLists.txt:57 (include)
RealTimeChris commented 5 months ago

I noticed you were getting

[...]/build/_deps/jsonifier-src/CMake/BuildFeatureTester.sh: line 3: cmake: command not found

Before - perhaps is cmake not on your PATH?

stephenberry commented 5 months ago

That's right, CMake is not in my path and shouldn't need to be.

RealTimeChris commented 5 months ago

Alright if you pull from the dev branch it should be fixed now.

stephenberry commented 5 months ago

I'm getting build issues. It looks like the parseJson API might have changed. It might just be the test code that needs updating.

RealTimeChris commented 5 months ago

Yes and it was fixed. Thanks.

stephenberry commented 4 months ago

Sweet, Jsonifier is building and running on my Mac now. Will update these benchmarks soon.