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

refactored refl-cpp and (de-)serialiser to be an optional dependency #113

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion bench/bm_pmt_dict_pack_unpack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,24 @@
#include <iostream>
#include <string>

#if defined(__clang__) || defined(__GNUC__)
#pragma GCC diagnostic push // ignore warning of external libraries that from this lib-context we do not have any control over
#pragma GCC diagnostic ignored "-Wall"
#pragma GCC diagnostic ignored "-Wold-style-cast"
#pragma GCC diagnostic ignored "-Wimplicit-int-float-conversion"
#ifndef __clang__ // only for GCC, not Clang
#pragma GCC diagnostic ignored "-Wuseless-cast"
#endif
#endif

#include "CLI/App.hpp"
#include "CLI/Config.hpp"
#include "CLI/Formatter.hpp"

#if defined(__clang__) || defined(__GNUC__)
#pragma GCC diagnostic pop
#endif

#include <pmtv/pmt.hpp>
#include <pmtv/format.hpp>

Expand Down Expand Up @@ -74,7 +88,7 @@ int main(int argc, char* argv[])
auto valid = run_test(samples, items);

auto t2 = std::chrono::steady_clock::now();
auto time = 1e-9 * static_cast<long double>(std::chrono::duration_cast<std::chrono::nanoseconds>(t2 - t1).count());
auto time = static_cast<long double>(1e-9) * static_cast<long double>(std::chrono::duration_cast<std::chrono::nanoseconds>(t2 - t1).count());

std::cout << "[PROFILE_TIME]" << time << "[PROFILE_TIME]" << std::endl;
std::cout << "[PROFILE_VALID]" << valid << "[PROFILE_VALID]" << std::endl;
Expand Down
16 changes: 15 additions & 1 deletion bench/bm_pmt_dict_ref.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,24 @@
#include <iostream>
#include <string>

#if defined(__clang__) || defined(__GNUC__)
#pragma GCC diagnostic push // ignore warning of external libraries that from this lib-context we do not have any control over
#pragma GCC diagnostic ignored "-Wall"
#pragma GCC diagnostic ignored "-Wold-style-cast"
#pragma GCC diagnostic ignored "-Wimplicit-int-float-conversion"
#ifndef __clang__ // only for GCC, not Clang
#pragma GCC diagnostic ignored "-Wuseless-cast"
#endif
#endif

#include "CLI/App.hpp"
#include "CLI/Config.hpp"
#include "CLI/Formatter.hpp"

#if defined(__clang__) || defined(__GNUC__)
#pragma GCC diagnostic pop
#endif

#include <pmtv/pmt.hpp>
#include <pmtv/format.hpp>

Expand Down Expand Up @@ -66,7 +80,7 @@ int main(int argc, char* argv[])
auto valid = run_test(samples, d, index);

auto t2 = std::chrono::steady_clock::now();
auto time = 1e-9 * static_cast<long double>(std::chrono::duration_cast<std::chrono::nanoseconds>(t2 - t1).count());
auto time = static_cast<long double>(1e-9) * static_cast<long double>(std::chrono::duration_cast<std::chrono::nanoseconds>(t2 - t1).count());

std::cout << "[PROFILE_TIME]" << time << "[PROFILE_TIME]" << std::endl;
std::cout << "[PROFILE_VALID]" << valid << "[PROFILE_VALID]" << std::endl;
Expand Down
17 changes: 16 additions & 1 deletion bench/bm_pmt_serialize_uvec.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
#include <chrono>
#include <iostream>

#if defined(__clang__) || defined(__GNUC__)
#pragma GCC diagnostic push // ignore warning of external libraries that from this lib-context we do not have any control over
#pragma GCC diagnostic ignored "-Wall"
#pragma GCC diagnostic ignored "-Wold-style-cast"
#pragma GCC diagnostic ignored "-Wimplicit-int-float-conversion"
#ifndef __clang__ // only for GCC, not Clang
#pragma GCC diagnostic ignored "-Wuseless-cast"
#endif
#endif

#include "CLI/App.hpp"
#include "CLI/Config.hpp"
#include "CLI/Formatter.hpp"

#if defined(__clang__) || defined(__GNUC__)
#pragma GCC diagnostic pop
#endif

#include <pmtv/pmt.hpp>
#include <pmtv/serialiser.hpp>

using namespace pmtv;

Expand Down Expand Up @@ -49,7 +64,7 @@ int main(int argc, char* argv[])
auto valid = run_test(samples, data);

auto t2 = std::chrono::steady_clock::now();
auto time = 1e-9 * static_cast<long double>(std::chrono::duration_cast<std::chrono::nanoseconds>(t2 - t1).count());
auto time = static_cast<long double>(1e-9) * static_cast<long double>(std::chrono::duration_cast<std::chrono::nanoseconds>(t2 - t1).count());

std::cout << "[PROFILE_TIME]" << time << "[PROFILE_TIME]" << std::endl;
std::cout << "[PROFILE_VALID]" << valid << "[PROFILE_VALID]" << std::endl;
Expand Down
1 change: 1 addition & 0 deletions include/pmtv/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ files = [
'pmt.hpp',
'rva_variant.hpp',
'type_helpers.hpp',
'serialiser.hpp',
'version.hpp'
]

Expand Down
Loading