From 8a7f05acda14acbaf3e5962f481782d6c1a4d850 Mon Sep 17 00:00:00 2001 From: Jeff Date: Mon, 18 Dec 2023 15:35:04 -0500 Subject: [PATCH] Add bench script --- Cargo.lock | 2 +- scripts/bench.fish | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 scripts/bench.fish diff --git a/Cargo.lock b/Cargo.lock index 25b4d21..7496f6f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -316,7 +316,7 @@ dependencies = [ [[package]] name = "dust-lang" -version = "0.3.7" +version = "0.3.8" dependencies = [ "ansi_term", "cc", diff --git a/scripts/bench.fish b/scripts/bench.fish new file mode 100644 index 0000000..47ba13f --- /dev/null +++ b/scripts/bench.fish @@ -0,0 +1,16 @@ +# This script is has the following prerequisites (aside from fish): +# - hyperfine +# - dust (can be installed with "cargo install dust-lang") +# - jq +# - nodejs +# - nushell +# - dielectron.json (can be downloaded from https://opendata.cern.ch/record/304) + +hyperfine + --shell none + --parameter-list data_path examples/assets/seaCreatures.json,examples/assets/jq_data.json,dielectron.json + --warmup 3 + "dust -c '(length (from_json input))' -p {data_path}" + "jq 'length' {data_path}" + "node --eval \"require('node:fs').readFile('{data_path}', (err, data)=>{console.log(JSON.parse(data).length)})\"" + "nu -c 'open {data_path} | length'"