Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changes/async.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"eval-stack": patch:perf
---

Improve the performance of the async I/O operations.
7 changes: 4 additions & 3 deletions src/case.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::{fs::create_dir_all, path::PathBuf, time::Duration};
use std::{path::PathBuf, time::Duration};

use anyhow::Result;
use tokio::fs::{create_dir_all, remove_dir_all};
use which::which;

use crate::{
Expand All @@ -25,7 +26,7 @@ where
let workspace: PathBuf = workspace.into();

if !workspace.exists() {
create_dir_all(&workspace)?;
create_dir_all(&workspace).await?;
}

let source_file_path = Into::<PathBuf>::into(source_file_path)
Expand Down Expand Up @@ -97,7 +98,7 @@ where
}

if clean {
if let Err(e) = std::fs::remove_dir_all(workspace) {
if let Err(e) = remove_dir_all(workspace).await {
anyhow::bail!("Failed to remove workspace: {}", e);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/engine/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ pub async fn handle_submission(
submission
.test_cases
.into_iter()
.map(|_tc| ("tests/1.in", "tests/1.out"))
.map(|tc| (tc.input, tc.output))
.collect(),
true,
)
Expand Down
Loading