-
Couldn't load subscription status.
- Fork 1
Benchmark deserialization #198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
f0ba260 to
6a93dfb
Compare
540f93e to
03f999f
Compare
ee940a2 to
6b118d8
Compare
0df8858 to
39998cc
Compare
|
@Stapox35 If you already have charts drawn using code from this PR, please upload them here in a comment. |
benchmark/logic/ser.js
Outdated
| function createKeyspace(next) { | ||
| // Keep replication one to reduce time spent in the database | ||
| const query = | ||
| "CREATE KEYSPACE IF NOT EXISTS benchmarks WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': '1' }"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🌱 We should compare results with tablets turned on and off.
3e309f1 to
268b8d0
Compare
| use std::sync::Arc; | ||
| use uuid::Uuid; | ||
|
|
||
| const CONCURRENCY: usize = 2000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ 🤔 Here I can see CONCURRENCY hard-coded. I don't see an equivalent constant in JS benchark code. Where is it?
| let mut handles = vec![]; | ||
| let session = Arc::new(session); | ||
|
|
||
| for i in 0..CONCURRENCY { | ||
| let session_clone = Arc::clone(&session); | ||
| let insert_query_clone = insert_query.clone(); | ||
| handles.push(tokio::spawn(async move { | ||
| insert_data(session_clone, i, n, &insert_query_clone) | ||
| .await | ||
| .unwrap(); | ||
| })); | ||
| } | ||
|
|
||
| let results = join_all(handles).await; | ||
|
|
||
| for result in results { | ||
| result.unwrap(); | ||
| } | ||
|
|
||
| let select_query = session.prepare("SELECT * FROM benchmarks.basic").await?; | ||
|
|
||
| let mut handles = vec![]; | ||
|
|
||
| for i in 0..CONCURRENCY { | ||
| let session_clone = Arc::clone(&session); | ||
| let select_query_clone = select_query.clone(); | ||
| handles.push(tokio::spawn(async move { | ||
| select_data(session_clone, i, n, &select_query_clone) | ||
| .await | ||
| .unwrap(); | ||
| })); | ||
| } | ||
|
|
||
| let results = join_all(handles).await; | ||
|
|
||
| for result in results { | ||
| result.unwrap(); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔧 The logic is duplicated. Please extract the common part to a higher-order function that will accept a closure/Future performing the action. Hint: I'd make the function accept impl Future<Item = Vec<Result<QueryResult, ExecutionError>>>.
044b350 to
b9c72a6
Compare
b9c72a6 to
edf2fc7
Compare
2c4d441 to
e5c09c8
Compare
16128e9 to
6300c7f
Compare
The base branch was changed.
|
I'd really like to see this merged. Can we get this mergeable soon? |
uuid, int, timeuuid, inet, date, time
uuid, int, timeuuid, inet, date, time
edf2fc7 to
80200da
Compare
Add 4 new benchmarks:
This benchmark uses
executeConcurrentendpoint to insertnrows containinguuid,int,timeuuid,inet,date,timeinto the database. Afterwards it usesexecuteConcurrentendpoint to select all (n) of the inserted rows from the databasentimes.JS:
Rust:
This benchmark executes
nclient.executequeries, that insert a single row containinguuid,int,timeuuid,inet,date,timewaiting for the result of the previous query before executing the next one. Afterwards it executesnclient.executequeries, that select all (n) of the inserted rows, waiting for the result of the previous query before executing the next one.JS:
Rust:
This benchmark uses
executeConcurrentendpoint to insertn*nrows containinguuid,int,timeuuid,inet,date,timeinto the database.JS:
Rust:
This benchmark executes
n*nclient.executequeries, that insert a single row containinguuid,int,timeuuid,inet,date,timewaiting for the result of the previous query before executing the next one.JS:
Rust: