Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added zpp_bits performance benchmark. #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

eyalz800
Copy link

Hope to get this included

@eyalz800 eyalz800 force-pushed the master branch 2 times, most recently from 6d0193d to de9b8f6 Compare August 21, 2022 10:44
@chronoxor
Copy link
Owner

Latest Visual Studio 2022:

       "Z:\projects\chronoxor\CppSerialization\temp\ALL_BUILD.vcxproj" (default target) (3) ->
       "Z:\projects\chronoxor\CppSerialization\temp\cppserialization-performance-zpp_serialize.vcxproj" (default target) (99) ->
       (ClCompile target) ->
         Z:\projects\chronoxor\CppSerialization\modules\zpp_bits/zpp_bits.h(1928,27): error C2672: 'zpp::bits::basic_out<ByteView>::serialize_one': no matching overloaded function found [Z:\projects\chronoxor\Cpp
       Serialization\temp\cppserialization-performance-zpp_serialize.vcxproj]
         Z:\projects\chronoxor\CppSerialization\modules\zpp_bits/zpp_bits.h(1927,1): error C3536: 'result': cannot be used before it is initialized [Z:\projects\chronoxor\CppSerialization\temp\cppserialization-pe
       rformance-zpp_serialize.vcxproj]
         Z:\projects\chronoxor\CppSerialization\modules\zpp_bits/zpp_bits.h(1928,54): error C2665: 'zpp::bits::failure': none of the 2 overloads could convert all the argument types [Z:\projects\chronoxor\CppSeri
       alization\temp\cppserialization-performance-zpp_serialize.vcxproj]
         Z:\projects\chronoxor\CppSerialization\modules\zpp_bits/zpp_bits.h(1930,1): error C2440: 'return': cannot convert from 'int' to 'zpp::bits::errc' [Z:\projects\chronoxor\CppSerialization\temp\cppserializa
       tion-performance-zpp_serialize.vcxproj]

@eyalz800
Copy link
Author

Oh wow, will check, do you have the full error because I don’t have VS? Also if you have visual studio on your CI can you approve for me to run on this so my pull request will pass the CI before merging?

@eyalz800
Copy link
Author

Ok I found the error and reproduced it, but I am not sure currently how to fix because it looks like VS has an issue here unless I'm missing something:

https://raw.githubusercontent.com/eyalz800/zpp_bits/main/zpp_bits.h(1928): note: 'zpp::bits::errc zpp::bits::basic_out<ByteView>::serialize_one(auto (&)[Count])': could not deduce template argument for 'auto (&)[Count]' from 'char [10]'

@eyalz800
Copy link
Author

Workaround, will merge soon eyalz800/zpp_bits#88

@eyalz800
Copy link
Author

eyalz800 commented Aug 21, 2022

@chronoxor fixed on my end with the patch above. Perhaps worth opening an issue to VS2022, I will consider doing so if I get free time.

@eyalz800
Copy link
Author

eyalz800 commented Aug 21, 2022

Looks like an issue with absl include directories is preventing to compile when I execute from the CI - https://github.com/eyalz800/CppSerialization/runs/7939382559?check_suite_focus=true

2022-08-21T14:11:19.4328568Z In file included from /home/runner/work/CppSerialization/CppSerialization/proto/protobuf/trade.pb.cc:4:
2022-08-21T14:11:19.4329106Z In file included from /home/runner/work/CppSerialization/CppSerialization/proto/protobuf/trade.pb.h:28:
2022-08-21T14:11:19.4329638Z In file included from /home/runner/work/CppSerialization/CppSerialization/modules/protobuf/src/google/protobuf/generated_message_reflection.h:47:
2022-08-21T14:11:19.4331358Z /home/runner/work/CppSerialization/CppSerialization/modules/protobuf/src/google/protobuf/descriptor.h:71:10: fatal error: 'absl/synchronization/mutex.h' file not found
2022-08-21T14:11:19.4331984Z #include "absl/synchronization/mutex.h"
2022-08-21T14:11:19.4332827Z          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2022-08-21T14:11:19.6843233Z 1 error generated.
2022-08-21T14:11:19.6909804Z make[2]: *** [CMakeFiles/proto.dir/build.make:85: CMakeFiles/proto.dir/proto/protobuf/trade.pb.cc.o] Error 1
2022-08-21T14:11:19.6910562Z make[2]: *** Waiting for unfinished jobs....
2022-08-21T14:11:20.2410052Z make[1]: *** [CMakeFiles/Makefile2:1062: CMakeFiles/proto.dir/all] Error 2
2022-08-21T14:11:20.2411123Z make: *** [Makefile:146: all] Error 2
2022-08-21T14:11:20.2439622Z ##[error]Process completed with exit code 2.
2022-08-21T14:11:20.2497930Z Post job cleanup.
2022-08-21T14:11:20.3799112Z [command]/usr/bin/git version
2022-08-21T14:11:20.3802999Z git version 2.37.2
2022-08-21T14:11:20.3805424Z Temporarily overriding HOME='/home/runner/work/_temp/f7dcd589-ac83-41c2-8940-67fff39af2c3' before making global git config changes
2022-08-21T14:11:20.3805891Z Adding repository directory to the temporary git global config as a safe directory
2022-08-21T14:11:20.3806997Z [command]/usr/bin/git config --global --add safe.directory /home/runner/work/CppSerialization/CppSerialization
2022-08-21T14:11:20.3856439Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
2022-08-21T14:11:20.3895642Z [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :
2022-08-21T14:11:20.4171791Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2022-08-21T14:11:20.4204830Z http.https://github.com/.extraheader
2022-08-21T14:11:20.4214870Z [command]/usr/bin/git config --local --unset-all http.https://github.com/.extraheader
2022-08-21T14:11:20.4253831Z [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :
2022-08-21T14:11:20.4706068Z Cleaning up orphan processes

@eyalz800
Copy link
Author

Rebased.

@eyalz800
Copy link
Author

Rebased

@eyalz800 eyalz800 force-pushed the master branch 2 times, most recently from 94859d1 to e241776 Compare August 23, 2022 17:22
@eyalz800
Copy link
Author

eyalz800 commented Aug 23, 2022

My results (I just ran mine only):

./cppserialization-performance-zpp_serialize                                                                                                                                                                                                                                                                              
[ 20%] Launching ZppBits-Serialize. Attempt 1...Done!
[ 40%] Launching ZppBits-Serialize. Attempt 2...Done!
[ 60%] Launching ZppBits-Serialize. Attempt 3...Done!
[ 80%] Launching ZppBits-Serialize. Attempt 4...Done!
[100%] Launching ZppBits-Serialize. Attempt 5...Done!
===============================================================================
CppBenchmark report. Version 1.0.2.0
===============================================================================
CPU architecture: Apple M1 Max
CPU logical cores: 10
CPU physical cores: 10
CPU clock speed: -1 Hz
CPU Hyper-Threading: disabled
RAM total: 64.000 GiB
RAM free: 3.074 GiB
===============================================================================
OS version: 21.4.0
OS bits: 64-bit
Process bits: 64-bit
Process configuration: release
Local timestamp: Tue Aug 23 20:25:33 2022
UTC timestamp: Tue Aug 23 17:25:33 2022
===============================================================================
Benchmark: ZppBits-Serialize
Attempts: 5
Duration: 5 seconds
-------------------------------------------------------------------------------
Phase: ZppBits-Serialize
Average time: 17 ns/op
Minimal time: 20 ns/op
Maximal time: 20 ns/op
Total time: 5.487 s
Total operations: 315929253
Total bytes: 38.256 GiB
Operations throughput: 57576878 ops/s
Bytes throughput: 6.994 GiB/s
Custom values:
        Size: 130
===============================================================================

./cppserialization-performance-zpp_deserialize                                                                                                                                                                                                                                                                            ─╯
[ 20%] Launching ZppBits-Deserialize. Attempt 1...Done!
[ 40%] Launching ZppBits-Deserialize. Attempt 2...Done!
[ 60%] Launching ZppBits-Deserialize. Attempt 3...Done!
[ 80%] Launching ZppBits-Deserialize. Attempt 4...Done!
[100%] Launching ZppBits-Deserialize. Attempt 5...Done!
===============================================================================
CppBenchmark report. Version 1.0.2.0
===============================================================================
CPU architecture: Apple M1 Max
CPU logical cores: 10
CPU physical cores: 10
CPU clock speed: -1 Hz
CPU Hyper-Threading: disabled
RAM total: 64.000 GiB
RAM free: 2.858 GiB
===============================================================================
OS version: 21.4.0
OS bits: 64-bit
Process bits: 64-bit
Process configuration: release
Local timestamp: Tue Aug 23 20:26:21 2022
UTC timestamp: Tue Aug 23 17:26:21 2022
===============================================================================
Benchmark: ZppBits-Deserialize
Attempts: 5
Duration: 5 seconds
-------------------------------------------------------------------------------
Phase: ZppBits-Deserialize
Average time: 17 ns/op
Minimal time: 21 ns/op
Maximal time: 21 ns/op
Total time: 5.756 s
Total operations: 321776202
Total bytes: 38.981 GiB
Operations throughput: 55898938 ops/s
Bytes throughput: 6.786 GiB/s
Custom values:
        Size: 130
===============================================================================

@eyalz800 eyalz800 force-pushed the master branch 3 times, most recently from ad5312e to a65b8a1 Compare September 3, 2022 08:10
@eyalz800
Copy link
Author

eyalz800 commented Sep 3, 2022

Managed to run the benchmark in the CI - https://github.com/eyalz800/CppSerialization/runs/8168287047?check_suite_focus=true

@eyalz800
Copy link
Author

eyalz800 commented Sep 6, 2022

Looks like the PR passes the CI now

@tuket
Copy link

tuket commented Jul 29, 2024

I'm curious how zpp_bits compares to other libraries. Will this ever get merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants