Skip to content

Commit

Permalink
feat: add memory fs (#8372)
Browse files Browse the repository at this point in the history
  • Loading branch information
jerrykingxyz authored Nov 8, 2024
1 parent b77d7de commit 9ea18ae
Show file tree
Hide file tree
Showing 4 changed files with 523 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crates/rspack_fs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ dunce = { version = "1.0.5" }
futures = { workspace = true }
rspack_error = { path = "../rspack_error", version = "0.1.0" }
rspack_paths = { path = "../rspack_paths", version = "0.1.0" }
tokio = { workspace = true, features = ["fs"] }
tokio = { workspace = true, features = ["fs", "test-util", "macros"] }
2 changes: 1 addition & 1 deletion crates/rspack_fs/src/file_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::fs::Metadata;

use crate::{Error, Result};

#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct FileMetadata {
pub is_file: bool,
pub is_directory: bool,
Expand Down
3 changes: 3 additions & 0 deletions crates/rspack_fs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@ mod macros;
mod native_fs;
pub use native_fs::NativeFileSystem;

mod memory_fs;
pub use memory_fs::MemoryFileSystem;

mod error;
pub use error::{Error, Result};
Loading

2 comments on commit 9ea18ae

@rspack-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Benchmark detail: Open

Name Base (2024-11-08 dfbe05f) Current Change
10000_big_production-mode + exec 44.5 s ± 1.64 s 44.1 s ± 1.18 s -1.11 %
10000_development-mode + exec 1.84 s ± 19 ms 1.85 s ± 24 ms +0.36 %
10000_development-mode_hmr + exec 644 ms ± 4.5 ms 643 ms ± 5.1 ms -0.14 %
10000_production-mode + exec 2.43 s ± 34 ms 2.43 s ± 34 ms +0.13 %
arco-pro_development-mode + exec 1.79 s ± 60 ms 1.81 s ± 75 ms +0.79 %
arco-pro_development-mode_hmr + exec 430 ms ± 2.3 ms 430 ms ± 1.9 ms +0.11 %
arco-pro_production-mode + exec 3.2 s ± 61 ms 3.17 s ± 79 ms -0.97 %
arco-pro_production-mode_generate-package-json-webpack-plugin + exec 3.25 s ± 63 ms 3.26 s ± 53 ms +0.08 %
threejs_development-mode_10x + exec 1.59 s ± 15 ms 1.6 s ± 20 ms +0.61 %
threejs_development-mode_10x_hmr + exec 777 ms ± 7.8 ms 779 ms ± 5.6 ms +0.30 %
threejs_production-mode_10x + exec 4.99 s ± 40 ms 4.99 s ± 15 ms 0.00 %

@rspack-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Ran ecosystem CI: Open

suite result
modernjs ✅ success
_selftest ✅ success
rspress ✅ success
rslib ✅ success
rsbuild ✅ success
examples ✅ success
devserver ✅ success

Please sign in to comment.