Skip to content

Commit 379fcd7

Browse files
committed
chore: release version 0.1.0-beta.1
1 parent 72d3a8a commit 379fcd7

11 files changed

Lines changed: 376 additions & 159 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ All notable changes to Rush-FS are documented here. The format is based on [Keep
1414

1515
- **Package name:** The main npm package is now **`@rush-fs/core`** (scoped). Install with `pnpm add @rush-fs/core` or `npm i @rush-fs/core`, and import with `import { readdir, readFile, ... } from '@rush-fs/core'`.
1616
- **Migration from `rush-fs`:** If you were using the old unscoped package `rush-fs`, replace it with `@rush-fs/core` in `package.json` and in all imports. The API is unchanged; only the package name and version differ. The old `rush-fs` package may be deprecated on npm in a separate step; prefer `@rush-fs/core` for new installs.
17+
- **glob:** `gitIgnore` option now defaults to **`false`** to align with Node.js `fs.globSync` (no .gitignore filtering by default).
18+
19+
### Fixed
20+
21+
- **glob:** Patterns with a path prefix (e.g. `.dir/**/*.txt` or `src/**/*.ts`) now work when used without an explicit `cwd`; the prefix is used as the search root, matching Node.js behavior.
22+
- **glob:** Recursive pattern `**/*.ext` with `cwd` now correctly recurses into subdirectories.
1723

1824
## [0.0.5]
1925

@@ -36,8 +42,8 @@ All notable changes to Rush-FS are documented here. The format is based on [Keep
3642

3743
---
3844

39-
[Unreleased]: https://github.com/CoderSerio/rush-fs/compare/v0.1.0-beta.0...HEAD
40-
[0.1.0-beta.0]: https://github.com/CoderSerio/rush-fs/compare/v0.0.5...v0.1.0-beta.0
45+
[Unreleased]: https://github.com/CoderSerio/rush-fs/compare/v0.1.0-beta.1...HEAD
46+
[0.1.0]: https://github.com/CoderSerio/rush-fs/compare/v0.0.5...v0.1.0-beta.1
4147
[0.0.5]: https://github.com/CoderSerio/rush-fs/compare/v0.0.4...v0.0.5
4248
[0.0.4]: https://github.com/CoderSerio/rush-fs/compare/v0.0.3...v0.0.4
4349
[0.0.3]: https://github.com/CoderSerio/rush-fs/releases/tag/v0.0.3

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
authors = []
44
edition = "2021"
55
name = "rush_fs"
6-
version = "0.1.0-beta.0"
6+
version = "0.1.0-beta.1"
77

88
[lib]
99
crate-type = ["cdylib"]

README.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<img src="https://img.shields.io/badge/Written%20in-Rust-orange?style=flat-square" alt="Written in Rust">
99
<img src="https://img.shields.io/npm/v/@rush-fs/core?style=flat-square" alt="NPM Version">
1010
<img src="https://img.shields.io/npm/l/@rush-fs/core?style=flat-square" alt="License">
11-
<img src="https://img.shields.io/badge/status-alpha-orange?style=flat-square" alt="Alpha">
11+
<img src="https://img.shields.io/badge/status-beta-orange?style=flat-square" alt="Beta">
1212
<a href="https://github.com/CoderSerio/rush-fs/graphs/contributors"><img src="https://img.shields.io/github/contributors/CoderSerio/rush-fs?style=flat-square" alt="Contributors"></a>
1313
</p>
1414

@@ -35,7 +35,7 @@ When you install `@rush-fs/core`, the package manager should automatically insta
3535
**Windows x64:** `pnpm add @rush-fs/rush-fs-win32-x64-msvc`
3636
**Linux x64 (glibc):** `pnpm add @rush-fs/rush-fs-linux-x64-gnu`
3737

38-
**Migration from `rush-fs`:** The package was renamed to `@rush-fs/core`. See [CHANGELOG.md](./CHANGELOG.md#010-alpha0) for details.
38+
**Migration from `rush-fs`:** The package was renamed to `@rush-fs/core`. See [CHANGELOG.md](./CHANGELOG.md#010) for details.
3939

4040
## Usage
4141

@@ -75,30 +75,30 @@ await rm('./temp', { recursive: true, force: true })
7575

7676
These are the scenarios where Rust's parallelism and zero-copy I/O make a real difference:
7777

78-
| Scenario | Node.js | Rush-FS | Speedup |
79-
| ------------------------------------------------ | --------- | -------- | --------- |
80-
| `readdir` recursive (node_modules, ~30k entries) | 281 ms | 23 ms | **12x** |
81-
| `glob` recursive (`**/*.rs`) | 25 ms | 1.46 ms | **17x** |
82-
| `glob` recursive vs fast-glob | 102 ms | 1.46 ms | **70x** |
83-
| `copyFile` 4 MB | 4.67 ms | 0.09 ms | **50x** |
84-
| `readFile` 4 MB utf8 | 1.86 ms | 0.92 ms | **2x** |
85-
| `readFile` 64 KB utf8 | 42 µs | 18 µs | **2.4x** |
86-
| `rm` 2000 files (4 threads) | 92 ms | 53 ms | **1.75x** |
87-
| `access` R_OK (directory) | 4.18 µs | 1.55 µs | **2.7x** |
88-
| `cp` 500-file flat dir (4 threads) | 86.45 ms | 32.88 ms | **2.6x** |
89-
| `cp` tree dir ~363 nodes (4 threads) | 108.73 ms | 46.88 ms | **2.3x** |
78+
| Scenario | Node.js | Rush-FS | Speedup |
79+
| ----------------------------------------------------------------------- | --------- | -------- | --------- |
80+
| `readdir` recursive (node_modules, ~30k entries) | 281 ms | 23 ms | **12x** |
81+
| `copyFile` 4 MB | 4.67 ms | 0.09 ms | **50x** |
82+
| `readFile` 4 MB utf8 | 1.86 ms | 0.92 ms | **2x** |
83+
| `readFile` 64 KB utf8 | 42 µs | 18 µs | **2.4x** |
84+
| `rm` 2000 files (4 threads) | 92 ms | 53 ms | **1.75x** |
85+
| `access` R_OK (directory) | 4.18 µs | 1.55 µs | **2.7x** |
86+
| `cp` 500-file flat dir (4 threads) | 86.45 ms | 32.88 ms | **2.6x** |
87+
| `cp` tree dir ~363 nodes (4 threads) | 108.73 ms | 46.88 ms | **2.3x** |
88+
| `glob` large tree (`node_modules/**/*.json`, ~30k entries) vs fast-glob | 303 ms | 30 ms | **~10x** |
9089

9190
### On Par with Node.js
9291

93-
Single-file operations have a ~0.3 µs napi bridge overhead, making them roughly equivalent:
92+
Single-file operations have a ~0.3 µs napi bridge overhead. Recursive glob on a **small tree** is on par with node-glob; on **large trees** (e.g. node_modules) Rush-FS wins (see table above).
9493

95-
| Scenario | Node.js | Rush-FS | Ratio |
96-
| -------------------------- | ------- | ------- | ----- |
97-
| `stat` (single file) | 1.45 µs | 1.77 µs | 1.2x |
98-
| `readFile` small (Buffer) | 8.86 µs | 9.46 µs | 1.1x |
99-
| `writeFile` small (string) | 74 µs | 66 µs | 0.9x |
100-
| `writeFile` small (Buffer) | 115 µs | 103 µs | 0.9x |
101-
| `appendFile` | 30 µs | 27 µs | 0.9x |
94+
| Scenario | Node.js | Rush-FS | Ratio |
95+
| ----------------------------------------------------- | ------- | ------- | -------------------------------------- |
96+
| `stat` (single file) | 1.45 µs | 1.77 µs | 1.2x |
97+
| `readFile` small (Buffer) | 8.86 µs | 9.46 µs | 1.1x |
98+
| `writeFile` small (string) | 74 µs | 66 µs | 0.9x |
99+
| `writeFile` small (Buffer) | 115 µs | 103 µs | 0.9x |
100+
| `appendFile` | 30 µs | 27 µs | 0.9x |
101+
| `glob` recursive (`**/*.rs`, small tree) vs node-glob | ~22 ms | ~40 ms | ~1.8x (node-glob faster at this scale) |
102102

103103
### Where Node.js Wins
104104

@@ -125,7 +125,7 @@ Single-file operations (`stat`, `readFile`, `writeFile`, `chmod`, etc.) are atom
125125

126126
### Key Takeaway
127127

128-
**Rush-FS excels at recursive / batch filesystem operations** (readdir, glob, rm, cp) where Rust's parallel walkers deliver 2–70x speedups. For single-file operations it performs on par with Node.js. The napi bridge adds a fixed ~0.3 µs overhead per call, which only matters for sub-microsecond operations like `existsSync`.
128+
**Rush-FS excels at recursive / batch filesystem operations** (readdir, glob, rm, cp) where Rust's parallel walkers deliver significant speedups (e.g. 12x readdir, 50x copyFile). For single-file operations it performs on par with Node.js. The napi bridge adds a fixed ~0.3 µs overhead per call, which only matters for sub-microsecond operations like `existsSync`.
129129

130130
**`cp` benchmark detail** (Apple Silicon, release build):
131131

@@ -446,7 +446,7 @@ We are rewriting `fs` APIs one by one.
446446
withFileTypes?: boolean; //
447447
exclude?: string[]; //
448448
concurrency?: number; //
449-
gitIgnore?: boolean; //
449+
gitIgnore?: boolean; // default false (align with Node.js fs.globSync)
450450
};
451451
```
452452

README.zh-CN.md

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,14 @@
88
<img src="https://img.shields.io/badge/Written%20in-Rust-orange?style=flat-square" alt="Written in Rust">
99
<img src="https://img.shields.io/npm/v/@rush-fs/core?style=flat-square" alt="NPM Version">
1010
<img src="https://img.shields.io/npm/l/@rush-fs/core?style=flat-square" alt="License">
11-
<img src="https://img.shields.io/badge/status-alpha-orange?style=flat-square" alt="Alpha">
11+
<img src="https://img.shields.io/badge/status-beta-orange?style=flat-square" alt="Beta">
1212
<a href="https://github.com/CoderSerio/rush-fs/graphs/contributors"><img src="https://img.shields.io/github/contributors/CoderSerio/rush-fs?style=flat-square" alt="Contributors"></a>
1313
</p>
1414

1515
<p align="center">
1616
与 Node.js <code>fs</code> API 对齐,可无痛替换现有项目中的 fs;在海量文件操作场景下获得数倍于内置 fs 的性能,由 Rust 驱动。
1717
</p>
1818

19-
<p align="center"><strong>⚠️ Alpha:</strong>当前为 <strong>alpha</strong> 版本,在 0.1.0 正式版前 API 与行为可能变更。</p>
20-
</div>
21-
2219
## 安装
2320

2421
```bash
@@ -36,7 +33,7 @@ pnpm add @rush-fs/core
3633
**Windows x64:** `pnpm add @rush-fs/rush-fs-win32-x64-msvc`
3734
**Linux x64 (glibc):** `pnpm add @rush-fs/rush-fs-linux-x64-gnu`
3835

39-
**`rush-fs` 迁移:** 自 0.1.0-alpha 起主包更名为 `@rush-fs/core`,详见 [CHANGELOG.md](./CHANGELOG.md#010-alpha0)
36+
**`rush-fs` 迁移:** 主包更名为 `@rush-fs/core`,详见 [CHANGELOG.md](./CHANGELOG.md#010)
4037

4138
## 用法
4239

@@ -76,30 +73,30 @@ await rm('./temp', { recursive: true, force: true })
7673

7774
这些场景中 Rust 的并行遍历和零拷贝 I/O 发挥了真正优势:
7875

79-
| 场景 | Node.js | Rush-FS | 加速比 |
80-
| ------------------------------------------- | --------- | -------- | --------- |
81-
| `readdir` 递归(node_modules,约 3 万条目) | 281 ms | 23 ms | **12x** |
82-
| `glob` 递归(`**/*.rs`| 25 ms | 1.46 ms | **17x** |
83-
| `glob` 递归 vs fast-glob | 102 ms | 1.46 ms | **70x** |
84-
| `copyFile` 4 MB | 4.67 ms | 0.09 ms | **50x** |
85-
| `readFile` 4 MB utf8 | 1.86 ms | 0.92 ms | **2x** |
86-
| `readFile` 64 KB utf8 | 42 µs | 18 µs | **2.4x** |
87-
| `rm` 2000 个文件(4 线程) | 92 ms | 53 ms | **1.75x** |
88-
| `access` R_OK(目录) | 4.18 µs | 1.55 µs | **2.7x** |
89-
| `cp` 500 文件平铺目录(4 线程) | 86.45 ms | 32.88 ms | **2.6x** |
90-
| `cp` 树形目录 ~363 节点(4 线程) | 108.73 ms | 46.88 ms | **2.3x** |
76+
| 场景 | Node.js | Rush-FS | 加速比 |
77+
| ---------------------------------------------------------------- | --------- | -------- | --------- |
78+
| `readdir` 递归(node_modules,约 3 万条目) | 281 ms | 23 ms | **12x** |
79+
| `copyFile` 4 MB | 4.67 ms | 0.09 ms | **50x** |
80+
| `readFile` 4 MB utf8 | 1.86 ms | 0.92 ms | **2x** |
81+
| `readFile` 64 KB utf8 | 42 µs | 18 µs | **2.4x** |
82+
| `rm` 2000 个文件(4 线程) | 92 ms | 53 ms | **1.75x** |
83+
| `access` R_OK(目录) | 4.18 µs | 1.55 µs | **2.7x** |
84+
| `cp` 500 文件平铺目录(4 线程) | 86.45 ms | 32.88 ms | **2.6x** |
85+
| `cp` 树形目录 ~363 节点(4 线程) | 108.73 ms | 46.88 ms | **2.3x** |
86+
| `glob` 大树(`node_modules/**/*.json`,约 3 万条目)vs fast-glob | 303 ms | 30 ms | **~10x** |
9187

9288
### 与 Node.js 持平的场景
9389

94-
单文件操作有约 0.3 µs 的 napi 桥接开销,整体表现基本一致:
90+
单文件操作有约 0.3 µs 的 napi 桥接开销。递归 glob 在**小树**上与 node-glob 持平,在**大树**(如 node_modules)上 Rush-FS 明显更快(见上表)。
9591

96-
| 场景 | Node.js | Rush-FS | 比率 |
97-
| ---------------------------- | ------- | ------- | ---- |
98-
| `stat`(单文件) | 1.45 µs | 1.77 µs | 1.2x |
99-
| `readFile` 小文件(Buffer) | 8.86 µs | 9.46 µs | 1.1x |
100-
| `writeFile` 小文件(string) | 74 µs | 66 µs | 0.9x |
101-
| `writeFile` 小文件(Buffer) | 115 µs | 103 µs | 0.9x |
102-
| `appendFile` | 30 µs | 27 µs | 0.9x |
92+
| 场景 | Node.js | Rush-FS | 比率 |
93+
| ------------------------------------------ | ------- | ------- | -------------------------------- |
94+
| `stat`(单文件) | 1.45 µs | 1.77 µs | 1.2x |
95+
| `readFile` 小文件(Buffer) | 8.86 µs | 9.46 µs | 1.1x |
96+
| `writeFile` 小文件(string) | 74 µs | 66 µs | 0.9x |
97+
| `writeFile` 小文件(Buffer) | 115 µs | 103 µs | 0.9x |
98+
| `appendFile` | 30 µs | 27 µs | 0.9x |
99+
| `glob` 递归(`**/*.rs`,小树)vs node-glob | ~22 ms | ~40 ms | ~1.8x(此规模下 node-glob 更快) |
103100

104101
### Node.js 更快的场景
105102

@@ -126,7 +123,7 @@ Rush-FS 在文件系统遍历类操作中使用多线程并行:
126123

127124
### 核心结论
128125

129-
**Rush-FS 在递归/批量文件系统操作上表现卓越**(readdir、glob、rm、cp),Rust 的并行遍历器带来 2–70 倍加速。单文件操作与 Node.js 基本持平。napi 桥接带来固定约 0.3 µs 的每次调用开销,仅在亚微秒级操作(如 `existsSync`)中有感知。
126+
**Rush-FS 在递归/批量文件系统操作上表现卓越**(readdir、glob、rm、cp),Rust 的并行遍历器带来多倍加速(如 readdir 12x、copyFile 50x)。单文件操作与 Node.js 基本持平。napi 桥接带来固定约 0.3 µs 的每次调用开销,仅在亚微秒级操作(如 `existsSync`)中有感知。
130127

131128
**`cp` 基准详情**(Apple Silicon,release 构建):
132129

@@ -447,7 +444,7 @@ graph TD
447444
withFileTypes?: boolean; //
448445
exclude?: string[]; //
449446
concurrency?: number; //
450-
gitIgnore?: boolean; //
447+
gitIgnore?: boolean; // 默认 false,与 Node.js fs.globSync 一致
451448
};
452449
```
453450

0 commit comments

Comments
 (0)