Skip to content

Commit

Permalink
Update rust benchmarks (except rust_thruster) (LesnyRumcajs#350)
Browse files Browse the repository at this point in the history
* update rust_grpcio

* update rust_tonic
  • Loading branch information
LesnyRumcajs authored Jun 24, 2023
1 parent 02ae524 commit e4a9943
Show file tree
Hide file tree
Showing 9 changed files with 728 additions and 631 deletions.
361 changes: 237 additions & 124 deletions rust_grpcio_bench/Cargo.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions rust_grpcio_bench/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ lto = true

[dependencies]
jemallocator = "0.5.0"
grpcio = "0.10.3"
protobuf = "2.27.1"
futures = "0.3.24"
grpcio = "0.12"
protobuf = "2"
futures = "0.3"

[build-dependencies]
protoc-grpcio = "3.0"
protoc-grpcio = "3"

[[bin]]
name = "helloworld-server"
Expand Down
12 changes: 7 additions & 5 deletions rust_grpcio_bench/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::{io, thread};
use futures::channel::oneshot;
use futures::executor::block_on;
use futures::prelude::*;
use grpcio::{ChannelBuilder, Environment, RpcContext, ServerBuilder, UnarySink};
use grpcio::{ChannelBuilder, Environment, RpcContext, ServerBuilder, ServerCredentials, UnarySink};

use crate::proto::gen::helloworld::{HelloReply, HelloRequest};
use crate::proto::gen::helloworld_grpc::{create_greeter, Greeter};
Expand Down Expand Up @@ -39,16 +39,18 @@ fn main() {
let service = create_greeter(GreeterService);
let ch_builder = ChannelBuilder::new(env.clone());

let addr = "0.0.0.0:50051";
let mut server = ServerBuilder::new(env)
.register_service(service)
.bind("0.0.0.0", 50_051)
.channel_args(ch_builder.build_args())
.build()
.unwrap();
server
.add_listening_port(addr, ServerCredentials::insecure())
.unwrap();

server.start();
for (host, port) in server.bind_addrs() {
println!("listening on {}:{} ({} cpus)", host, port, cpus);
}
println!("listening on {addr} ({cpus} cpus)");
let (tx, rx) = oneshot::channel();
thread::spawn(move || {
println!("Press ENTER to exit...");
Expand Down
Loading

0 comments on commit e4a9943

Please sign in to comment.