Skip to content

Commit

Permalink
update bench script
Browse files Browse the repository at this point in the history
Signed-off-by: Jay Lee <[email protected]>
  • Loading branch information
BusyJay committed Feb 25, 2022
1 parent 591d56e commit 2526566
Show file tree
Hide file tree
Showing 4 changed files with 147 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tools/run_tests/performance/build_performance.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ do
"python_asyncio")
$bazel build -c opt //src/python/grpcio_tests/tests_aio/benchmark:worker
;;
"rust")
(cd ../grpc-rs/ && cargo build -p benchmark --release)
;;
*)
python tools/run_tests/run_tests.py -l "$language" -c "$CONFIG" --build_only -j 8
;;
Expand Down
19 changes: 19 additions & 0 deletions tools/run_tests/performance/run_worker_rust.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
# Copyright 2016 PingCAP, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# See the License for the specific language governing permissions and
# limitations under the License.

set -ex

cd $(dirname $0)/../../..

../grpc-rs/target/release/qps_worker $@
120 changes: 120 additions & 0 deletions tools/run_tests/performance/scenario_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1355,11 +1355,131 @@ def __str__(self):
return 'node_purejs'
return 'node'

class RustLanguage:

def __init__(self):
self.safename = str(self)

def worker_cmdline(self):
return ['tools/run_tests/performance/run_worker_rust.sh']

def worker_port_offset(self):
return 100

def scenarios(self):
yield _ping_pong_scenario(
'rust_generic_async_streaming_ping_pong',
rpc_type='STREAMING',
client_type='ASYNC_CLIENT',
server_type='ASYNC_GENERIC_SERVER',
use_generic_payload=True,
categories=[SMOKETEST, SCALABLE])

yield _ping_pong_scenario(
'rust_protobuf_async_streaming_ping_pong',
rpc_type='STREAMING',
client_type='ASYNC_CLIENT',
server_type='ASYNC_SERVER')

yield _ping_pong_scenario(
'rust_protobuf_async_unary_ping_pong',
rpc_type='UNARY',
client_type='ASYNC_CLIENT',
server_type='ASYNC_SERVER',
categories=[SMOKETEST, SCALABLE])

yield _ping_pong_scenario(
'rust_protobuf_sync_to_async_unary_ping_pong',
rpc_type='UNARY',
client_type='SYNC_CLIENT',
server_type='ASYNC_SERVER')

yield _ping_pong_scenario(
'rust_protobuf_async_unary_qps_unconstrained',
rpc_type='UNARY',
client_type='ASYNC_CLIENT',
server_type='ASYNC_SERVER',
unconstrained_client='async',
categories=[SMOKETEST,SCALABLE])

yield _ping_pong_scenario(
'rust_protobuf_async_streaming_qps_unconstrained',
rpc_type='STREAMING',
client_type='ASYNC_CLIENT',
server_type='ASYNC_SERVER',
unconstrained_client='async',
categories=[SCALABLE])

yield _ping_pong_scenario(
'rust_protobuf_async_streaming_from_client_unconstrained',
rpc_type='STREAMING_FROM_CLIENT',
client_type='ASYNC_CLIENT',
server_type='ASYNC_SERVER',
unconstrained_client='async',
categories=[SCALABLE])

yield _ping_pong_scenario(
'rust_to_cpp_protobuf_sync_unary_ping_pong',
rpc_type='UNARY',
client_type='SYNC_CLIENT',
server_type='SYNC_SERVER',
server_language='c++',
async_server_threads=1,
categories=[SMOKETEST, SCALABLE])

yield _ping_pong_scenario(
'rust_to_cpp_protobuf_async_streaming_ping_pong',
rpc_type='STREAMING',
client_type='ASYNC_CLIENT',
server_type='ASYNC_SERVER',
server_language='c++',
async_server_threads=1)

yield _ping_pong_scenario(
'rust_to_cpp_protobuf_async_unary_qps_unconstrained',
rpc_type='UNARY',
client_type='ASYNC_CLIENT',
server_type='ASYNC_SERVER',
unconstrained_client='async',
server_language='c++',
categories=[SCALABLE])

yield _ping_pong_scenario(
'rust_to_cpp_protobuf_sync_to_async_unary_qps_unconstrained',
rpc_type='UNARY',
client_type='SYNC_CLIENT',
server_type='ASYNC_SERVER',
unconstrained_client='sync',
server_language='c++',
categories=[SCALABLE])

yield _ping_pong_scenario(
'cpp_to_rust_protobuf_async_unary_qps_unconstrained',
rpc_type='UNARY',
client_type='ASYNC_CLIENT',
server_type='ASYNC_SERVER',
unconstrained_client='async',
client_language='c++',
categories=[SCALABLE])

yield _ping_pong_scenario(
'rust_protobuf_async_unary_ping_pong_1MB',
rpc_type='UNARY',
client_type='ASYNC_CLIENT',
server_type='ASYNC_SERVER',
req_size=1024*1024,
resp_size=1024*1024,
categories=[SMOKETEST, SCALABLE])


def __str__(self):
return 'rust'

LANGUAGES = {
'c++': CXXLanguage(),
'csharp': CSharpLanguage(),
'ruby': RubyLanguage(),
'rust': RustLanguage(),
'php7': Php7Language(),
'php7_protobuf_c': Php7Language(php7_protobuf_c=True),
'java': JavaLanguage(),
Expand Down
5 changes: 5 additions & 0 deletions update-branch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

patch=$(git rev-parse HEAD)
git checkout -b update-to-$1 $1
git cherry-pick $patch

0 comments on commit 2526566

Please sign in to comment.