-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
60 lines (56 loc) · 2 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//
// main.cpp
//
// (c) 2013 helloworld922
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//#include <boost/signals3/signals3.hpp>
//#include "test/connection_test.hpp"
//#include "test/slots_test.hpp"
#include "test/perf/single_thread_perf.hpp"
//#include "test/perf/multi_thread_perf.hpp"
#include "test/forward_test.hpp"
#include <iostream>
int
main(void)
{
// boost::signals3::test::forward::test();
// boost::signals3::test::connection::compile_test();
// boost::signals3::test::slots::compile_test();
constexpr uint64_t WORK_CONST = 15;
constexpr uint64_t NUM_SAMPLES = 1024ULL;
for (uint64_t i = 0; i < 6; ++i)
{
#if defined(SIGNALS3_ST_SAFE_PERF_TESTING)
boost::signals3::perf::signal3_safe_perf((1ULL << i) >> 1, 1ULL << (WORK_CONST - i), NUM_SAMPLES);
std::cout << std::endl;
#endif
#if defined(SIGNALS3_ST_UNSAFE_PERF_TESTING)
boost::signals3::perf::signal3_unsafe_perf((1ULL << i) >> 1, 1ULL << (WORK_CONST - i), NUM_SAMPLES);
std::cout << std::endl;
#endif
#if defined(SIGNALS2_ST_PERF_TESTING)
boost::signals3::perf::signal2_perf((1ULL << i) >> 1, 1ULL << (WORK_CONST - 1 - i), NUM_SAMPLES);
std::cout << std::endl;
#endif
for (uint64_t num_threads = 1; num_threads <= 8; num_threads *= 2)
{
#if defined(SIGNALS3_MT_PERF_TESTING)
boost::signals3::perf::signal3_perf((1ULL << i) >> 1, 1ULL << (WORK_CONST - i - num_threads / 4), NUM_SAMPLES,
num_threads);
std::cout << "\t";
// std::cout << std::endl;
#endif
#if defined(SIGNALS2_MT_PERF_TESTING)
boost::signals3::perf::signal2_perf((1ULL << i) >> 1, 1ULL << (WORK_CONST - i - num_threads / 4), NUM_SAMPLES,
num_threads);
std::cout << std::endl;
#endif
}
// std::cout << std::endl;
}
// std::cout << "done" << std::endl;
std::cin.ignore();
}