-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
621 additions
and
277 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
*.log | ||
.date | ||
Cargo.lock | ||
/target | ||
/.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[package] | ||
name = "bencher" | ||
version.workspace = true | ||
authors.workspace = true | ||
edition.workspace = true | ||
license.workspace = true | ||
publish.workspace = true | ||
|
||
[dependencies] | ||
tempfile.workspace = true | ||
time.workspace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
use std::{fs, path::PathBuf, process::Command}; | ||
|
||
use tempfile::NamedTempFile; | ||
use time::OffsetDateTime; | ||
|
||
fn main() { | ||
let now = OffsetDateTime::now_utc(); | ||
|
||
let metadata_path = NamedTempFile::new().unwrap().into_temp_path(); | ||
let metadata = Command::new("cargo") | ||
.args(["metadata"]) | ||
.output() | ||
.unwrap() | ||
.stdout; | ||
fs::write(&metadata_path, metadata).unwrap(); | ||
|
||
let mut bench_path = PathBuf::from("benchmark_results"); | ||
bench_path.push(&format!( | ||
"{}-{}-{}_{}-{}-{}", | ||
now.year(), | ||
now.month() as usize, | ||
now.day(), | ||
now.hour(), | ||
now.minute(), | ||
now.second(), | ||
)); | ||
|
||
let mut log_path = bench_path.clone(); | ||
log_path.set_extension("log"); | ||
let log = Command::new("cargo") | ||
.args(["bench"]) | ||
.output() | ||
.unwrap() | ||
.stdout; | ||
fs::write(&log_path, log).unwrap(); | ||
|
||
let mut json_path = bench_path.clone(); | ||
json_path.set_extension("json"); | ||
Command::new("cargo") | ||
.args(["run", "-p", "parser", "--", "--log"]) | ||
.arg(&log_path) | ||
.arg("--meta") | ||
.arg(&metadata_path) | ||
.arg("--output") | ||
.arg(&json_path) | ||
.status() | ||
.unwrap(); | ||
|
||
let mut config_path = PathBuf::from("tools"); | ||
config_path.push("config.json"); | ||
|
||
let mut template_path = PathBuf::from("tools"); | ||
template_path.push("README.md.template"); | ||
|
||
Command::new("cargo") | ||
.args(["run", "-p", "formatter", "--"]) | ||
.arg(&json_path) | ||
.arg("--config") | ||
.arg(&config_path) | ||
.arg("--template") | ||
.arg(&template_path) | ||
.args([ | ||
"--date", | ||
&format!( | ||
"{}-{}-{} {}:{}:{}", | ||
now.year(), | ||
now.month() as usize, | ||
now.day(), | ||
now.hour(), | ||
now.minute(), | ||
now.second(), | ||
), | ||
"--output", | ||
"README.md", | ||
]) | ||
.status() | ||
.unwrap(); | ||
|
||
metadata_path.close().unwrap(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"descriptions": { | ||
"log": "This data set is composed of HTTP request logs that are small and contain many strings.", | ||
"mesh": "This data set is a single mesh. The mesh contains an array of triangles, each of which has three vertices and a normal vector.", | ||
"mk48": "This data set is composed of mk48.io game updates that contain data with many exploitable patterns and invariants.", | ||
"minecraft_savedata": "This data set is composed of Minecraft player saves that contain highly structured data." | ||
}, | ||
"do_not_edit": "<!-- AUTOMATICALLY GENERATED, DO NOT EDIT -->\n<!-- edit README.md.template instead -->" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[package] | ||
name = "formatter" | ||
version.workspace = true | ||
authors.workspace = true | ||
edition.workspace = true | ||
license.workspace = true | ||
publish.workspace = true | ||
|
||
[dependencies] | ||
clap.workspace = true | ||
schema.workspace = true | ||
serde.workspace = true | ||
serde_json.workspace = true |
Oops, something went wrong.