Skip to content

Commit

Permalink
chore(benchmark): restore parser-10000-100 bench (#762)
Browse files Browse the repository at this point in the history
A benchmark with empty datas that has long AIR code with lot of variable (re-)assignments.
  • Loading branch information
monoid authored Nov 30, 2023
1 parent 2b83ad1 commit 7428cb3
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 58 deletions.
62 changes: 31 additions & 31 deletions benches/PERFORMANCE.json
Original file line number Diff line number Diff line change
Expand Up @@ -3739,52 +3739,52 @@
},
"total_time": "749.00µs"
},
"parser_10000_100": {
"comment": "Running very long AIR script with lot of variables and assignments",
"parser-10000-100": {
"comment": "long air script with lot of variable assignments",
"memory_sizes": [
"57.688 MiB",
"57.688 MiB"
],
"stats": {
"air::runner::execute_air": {
"common_prefix": "air",
"duration": "23.60ms",
"duration": "23.45ms",
"nested": {
"preparation_step::preparation::parse_data": "22.00µs",
"preparation_step::preparation::parse_data": "30.00µs",
"preparation_step::preparation::prepare": {
"common_prefix": "",
"duration": "21.93ms",
"duration": "21.84ms",
"nested": {
"air::preparation_step::preparation::make_exec_ctx": "14.00µs",
"air_parser::parser::air_parser::parse": "21.79ms"
"air::preparation_step::preparation::make_exec_ctx": "20.00µs",
"air_parser::parser::air_parser::parse": "21.66ms"
}
},
"runner::execute": "56.00µs",
"runner::execute": "45.00µs",
"runner::farewell": {
"common_prefix": "air::farewell_step::outcome",
"duration": "178.00µs",
"duration": "188.00µs",
"nested": {
"from_success_result": {
"common_prefix": "air::farewell_step::outcome",
"duration": "158.00µs",
"duration": "168.00µs",
"nested": {
"populate_outcome_from_contexts": "126.00µs"
"populate_outcome_from_contexts": "128.00µs"
}
}
}
},
"signing_step::sign_produced_cids": "104.00µs",
"signing_step::sign_produced_cids": "110.00µs",
"verification_step::verify": {
"common_prefix": "air_interpreter_data::cid_info",
"duration": "44.00µs",
"duration": "43.00µs",
"nested": {
"verify": "12.00µs"
}
}
}
}
},
"total_time": "23.60ms"
"total_time": "23.45ms"
},
"populate-map-multiple-keys": {
"comment": "benchmarking a map insert operation",
Expand Down Expand Up @@ -3893,7 +3893,7 @@
"total_time": "2.74ms"
}
},
"datetime": "2023-11-27 15:04:01.881477+00:00",
"datetime": "2023-11-29 16:50:22.959760+00:00",
"features": "check_signatures,gen_signatures",
"platform": "macOS-14.1.1-arm64-arm-64bit",
"version": "0.54.0"
Expand Down Expand Up @@ -5145,52 +5145,52 @@
},
"total_time": "848.00µs"
},
"parser_10000_100": {
"comment": "Running very long AIR script with lot of variables and assignments",
"parser-10000-100": {
"comment": "long air script with lot of variable assignments",
"memory_sizes": [
"57.688 MiB",
"57.688 MiB"
],
"stats": {
"air::runner::execute_air": {
"common_prefix": "air",
"duration": "30.20ms",
"duration": "29.56ms",
"nested": {
"preparation_step::preparation::parse_data": "16.00µs",
"preparation_step::preparation::parse_data": "20.00µs",
"preparation_step::preparation::prepare": {
"common_prefix": "",
"duration": "28.48ms",
"duration": "27.87ms",
"nested": {
"air::preparation_step::preparation::make_exec_ctx": "17.00µs",
"air_parser::parser::air_parser::parse": "28.28ms"
"air::preparation_step::preparation::make_exec_ctx": "18.00µs",
"air_parser::parser::air_parser::parse": "27.63ms"
}
},
"runner::execute": "31.00µs",
"runner::execute": "30.00µs",
"runner::farewell": {
"common_prefix": "air::farewell_step::outcome",
"duration": "258.00µs",
"duration": "257.00µs",
"nested": {
"from_success_result": {
"common_prefix": "air::farewell_step::outcome",
"duration": "236.00µs",
"duration": "235.00µs",
"nested": {
"populate_outcome_from_contexts": "194.00µs"
"populate_outcome_from_contexts": "196.00µs"
}
}
}
},
"signing_step::sign_produced_cids": "160.00µs",
"signing_step::sign_produced_cids": "161.00µs",
"verification_step::verify": {
"common_prefix": "air_interpreter_data::cid_info",
"duration": "36.00µs",
"duration": "34.00µs",
"nested": {
"verify": "11.00µs"
"verify": "10.00µs"
}
}
}
}
},
"total_time": "30.20ms"
"total_time": "29.56ms"
},
"populate-map-multiple-keys": {
"comment": "benchmarking a map insert operation",
Expand Down Expand Up @@ -5299,7 +5299,7 @@
"total_time": "3.62ms"
}
},
"datetime": "2023-11-27 15:10:46.006416+00:00",
"datetime": "2023-11-29 16:59:25.046502+00:00",
"features": "check_signatures,gen_signatures",
"platform": "Linux-5.15.0-76-generic-x86_64-with-glibc2.29",
"version": "0.54.0"
Expand Down
54 changes: 27 additions & 27 deletions benches/PERFORMANCE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ Machine c1f3ea5950db0a10b44da931c25774d64ab25084f47d504f72f311e694550ff1:
new: 38.00µs
Machine d77ebe8481884bc3b2778c8083f1bf459e548e929edd87041beb14f6b868d35f:
Platform: macOS-14.1.1-arm64-arm-64bit
Timestamp: 2023-11-27 15:04:01.881477+00:00
Timestamp: 2023-11-29 16:50:22.959760+00:00
AquaVM version: 0.54.0
Benches:
Features: check_signatures,gen_signatures
Expand Down Expand Up @@ -1005,18 +1005,18 @@ Machine d77ebe8481884bc3b2778c8083f1bf459e548e929edd87041beb14f6b868d35f:
signing_step::sign_produced_cids: 109.00µs
verification_step::verify: 39.00µs
verify: 12.00µs
parser_10000_100 (23.60ms; 57.688 MiB, 57.688 MiB): Running very long AIR script with lot of variables and assignments
air::runner::execute_air: 23.60ms
preparation_step::preparation::parse_data: 22.00µs
preparation_step::preparation::prepare: 21.93ms
air::preparation_step::preparation::make_exec_ctx: 14.00µs
air_parser::parser::air_parser::parse: 21.79ms
runner::execute: 56.00µs
runner::farewell: 178.00µs
from_success_result: 158.00µs
populate_outcome_from_contexts: 126.00µs
signing_step::sign_produced_cids: 104.00µs
verification_step::verify: 44.00µs
parser-10000-100 (23.45ms; 57.688 MiB, 57.688 MiB): long air script with lot of variable assignments
air::runner::execute_air: 23.45ms
preparation_step::preparation::parse_data: 30.00µs
preparation_step::preparation::prepare: 21.84ms
air::preparation_step::preparation::make_exec_ctx: 20.00µs
air_parser::parser::air_parser::parse: 21.66ms
runner::execute: 45.00µs
runner::farewell: 188.00µs
from_success_result: 168.00µs
populate_outcome_from_contexts: 128.00µs
signing_step::sign_produced_cids: 110.00µs
verification_step::verify: 43.00µs
verify: 12.00µs
populate-map-multiple-keys (3.44ms; 53.000 MiB, 53.000 MiB): benchmarking a map insert operation
air::runner::execute_air: 3.44ms
Expand Down Expand Up @@ -1048,7 +1048,7 @@ Machine d77ebe8481884bc3b2778c8083f1bf459e548e929edd87041beb14f6b868d35f:
verify: 75.00µs
Machine e536f8eaae8c978493a773ba566ae3393e2e6240d6ea8e05b5ca1b8f77e9c441:
Platform: Linux-5.15.0-76-generic-x86_64-with-glibc2.29
Timestamp: 2023-11-27 15:10:46.006416+00:00
Timestamp: 2023-11-29 16:59:25.046502+00:00
AquaVM version: 0.54.0
Benches:
Features: check_signatures,gen_signatures
Expand Down Expand Up @@ -1378,19 +1378,19 @@ Machine e536f8eaae8c978493a773ba566ae3393e2e6240d6ea8e05b5ca1b8f77e9c441:
signing_step::sign_produced_cids: 162.00µs
verification_step::verify: 39.00µs
verify: 12.00µs
parser_10000_100 (30.20ms; 57.688 MiB, 57.688 MiB): Running very long AIR script with lot of variables and assignments
air::runner::execute_air: 30.20ms
preparation_step::preparation::parse_data: 16.00µs
preparation_step::preparation::prepare: 28.48ms
air::preparation_step::preparation::make_exec_ctx: 17.00µs
air_parser::parser::air_parser::parse: 28.28ms
runner::execute: 31.00µs
runner::farewell: 258.00µs
from_success_result: 236.00µs
populate_outcome_from_contexts: 194.00µs
signing_step::sign_produced_cids: 160.00µs
verification_step::verify: 36.00µs
verify: 11.00µs
parser-10000-100 (29.56ms; 57.688 MiB, 57.688 MiB): long air script with lot of variable assignments
air::runner::execute_air: 29.56ms
preparation_step::preparation::parse_data: 20.00µs
preparation_step::preparation::prepare: 27.87ms
air::preparation_step::preparation::make_exec_ctx: 18.00µs
air_parser::parser::air_parser::parse: 27.63ms
runner::execute: 30.00µs
runner::farewell: 257.00µs
from_success_result: 235.00µs
populate_outcome_from_contexts: 196.00µs
signing_step::sign_produced_cids: 161.00µs
verification_step::verify: 34.00µs
verify: 10.00µs
populate-map-multiple-keys (4.37ms; 53.000 MiB, 53.000 MiB): benchmarking a map insert operation
air::runner::execute_air: 4.37ms
preparation_step::preparation::parse_data: 130.00µs
Expand Down
1 change: 1 addition & 0 deletions junk/gen-bench-data/gen_benchmark_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ for bench in multiple-cids10 \
populate-map-single-key \
call-requests500 \
call-results500 \
parser-10000-100 \
;
do
echo "Generating ${bench} ..." >&2
Expand Down
24 changes: 24 additions & 0 deletions junk/gen-bench-data/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ enum Bench {
BigValuesData,
CallRequests500,
CallResults500,
#[command(name="parser-10000-100")]
Parser10000_100,
}

fn main() {
Expand Down Expand Up @@ -81,6 +83,7 @@ fn main() {
Bench::BigValuesData => big_values_data(),
Bench::CallRequests500 => calls::call_requests(500),
Bench::CallResults500 => calls::call_results(500),
Bench::Parser10000_100 => parser_10000_100(),
};

save_data(&args.dest_dir, data).unwrap();
Expand Down Expand Up @@ -685,3 +688,24 @@ fn big_values_data() -> Data {
keypair: bs58::encode(keypair.as_inner().to_vec()).into_string(),
}
}

fn parser_10000_100() -> Data {
let air_script = include_str!("parser_10000_100.air");

let (keypair, peer_id) = derive_dummy_keypair("init_peer_id");
let particle_id = "particle_id";

Data {
air: air_script.to_owned(),
prev_data: vec![],
cur_data: vec![],
call_results: None,
keypair: bs58::encode(keypair.as_inner().to_vec()).into_string(),
params_json: hashmap! {
"comment".to_owned() => "long air script with lot of variable assignments".to_owned(),
"particle-id".to_owned() => particle_id.to_owned(),
"current-peer-id".to_owned() => peer_id.clone(),
"init-peer-id".to_owned() => peer_id,
},
}
}
1 change: 1 addition & 0 deletions junk/gen-bench-data/src/parser_10000_100.air

Large diffs are not rendered by default.

0 comments on commit 7428cb3

Please sign in to comment.