Skip to content

Commit d7b9c2a

Browse files
author
Thanh Phu
committed
Add run script
1 parent 1dbe3b8 commit d7b9c2a

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,7 @@ cmake-build-debug
3636

3737
# Visual studio
3838
.vs
39-
out
39+
out
40+
41+
result.txt
42+
nohup.out

flatbuffer/client.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,19 @@ void Run() {
4444
uint64_t total = 0;
4545
double create = 0, receive = 0, use = 0, free = 0;
4646

47-
std::string server_address(CLIENT_ACCESS_PROTO);
47+
std::string server_address(CLIENT_ACCESS_FBS);
4848

4949
auto channel =
5050
grpc::CreateChannel(server_address, grpc::InsecureChannelCredentials());
5151
FooBarClient client(channel);
5252

53-
grpc::ClientContext context;
54-
5553
// we use an outer loop also, since bumping up "iterations" to 10000 or so
5654
// puts so much strain on the allocator that use of free() dwarfs all
5755
// timings. Running the benchmark in batches gives more realistic timings and
5856
// keeps it accurate
5957
for (int j = 0; j < ITERATIONS_OUTER; j++) {
6058
flatbuffers::grpc::MessageBuilder mb;
59+
grpc::ClientContext context;
6160
InitTime();
6261

6362
double time1 = SecondsSinceStart();

runAll.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/zsh
2+
3+
nohup ./flatbuffer/fbbench_server &
4+
server1PID=$!
5+
nohup ./cmake-build-debug/buffer-bench-pb-server &
6+
server2PID=$!
7+
nohup ./cmake-build-debug/buffer-bench-raw-server &
8+
server3PID=$!
9+
10+
echo > result.txt
11+
for i in {1..10}
12+
do
13+
./flatbuffer/fbbench_client >> result.txt
14+
./cmake-build-debug/buffer-bench-pb-client >> result.txt
15+
./cmake-build-debug/buffer-bench-raw-client >> result.txt
16+
done
17+
18+
kill $server1PID $server2PID $server3PID

0 commit comments

Comments
 (0)