21 using namespace folly;
29 LOG(INFO) <<
"Running client. host = " << host <<
" port = " << port
30 <<
" numLoops = " << numLoops <<
" zeroCopy = " << zeroCopy
31 <<
" bufferSize = " << bufferSize;
36 &counter, &evb, numLoops, bufferSize, zeroCopy));
43 void runServer(
uint16_t port,
int numLoops,
bool zeroCopy,
size_t bufferSize) {
44 LOG(INFO) <<
"Running server. port = " << port <<
" numLoops = " << numLoops
45 <<
" zeroCopy = " << zeroCopy <<
" bufferSize = " << bufferSize;
52 server.addCallbackToServerSocket(*listenSock);
55 listenSock->bind(port);
56 listenSock->setZeroCopy(zeroCopy);
57 listenSock->listen(10);
58 listenSock->startAccepting();
67 void zeroCopyOn(
unsigned iters,
size_t bufferSize,
size_t numClients = 1) {
75 void zeroCopyOff(
unsigned iters,
size_t bufferSize,
size_t numClients = 1) {
133 gflags::ParseCommandLineFlags(&argc, &argv,
true);
142 }
else if (FLAGS_server) {
143 runServer(FLAGS_port, FLAGS_numLoops, FLAGS_zeroCopy, FLAGS_bufferSize);
DEFINE_string(host,"::1","host")
static auto constexpr kMaxLoops
static uint64_t test(std::string name, bool fc_, bool dedicated_, bool tc_, bool syncops_, uint64_t base)
DEFINE_bool(client, false,"client mode")
—— Concurrent Priority Queue Implementation ——
static auto constexpr kNumClients
bool runInEventBaseThread(void(*fn)(T *), T *arg)
void zeroCopyOff(unsigned iters, size_t bufferSize, size_t numClients=1)
int main(int argc, char **argv)
void zeroCopyOn(unsigned iters, size_t bufferSize, size_t numClients=1)
#define BENCHMARK_PARAM(name, param)
std::unique_ptr< AsyncServerSocket, Destructor > UniquePtr
std::atomic< int > counter
void zeroCopyOffMulti(unsigned iters, size_t bufferSize)
void zeroCopyOnMulti(unsigned iters, size_t bufferSize)
DEFINE_int32(numLoops, kMaxLoops,"number of loops")
ThreadPoolListHook * addr