Skip to content

Commit 6517a83

Browse files
committed
build: add bench info
1 parent d155daa commit 6517a83

File tree

4 files changed

+49
-67
lines changed

4 files changed

+49
-67
lines changed

crates/examples/bench/src/kill_tree_windows.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ static EXE_PATH: &str = "target/release/kill_tree_cli.exe";
55

66
fn main() {
77
init_log();
8-
let output = run(200, |target_process_id| {
8+
let output = run(300, |target_process_id| {
99
let mut command = Command::new(EXE_PATH);
1010
command.arg(target_process_id.to_string());
1111
command

crates/examples/bench/src/taskkill.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use example_bench::{init_log, run};
22
use std::process::Command;
33

4-
static EXE_PATH: &str = "taskkill.exe";
4+
static EXE_PATH: &str = "C:\\WINDOWS\\system32\\taskkill.exe";
55

66
fn main() {
77
init_log();
8-
let output = run(200, |target_process_id| {
8+
let output = run(300, |target_process_id| {
99
let mut command = Command::new(EXE_PATH);
1010
command.arg("/F").arg("/T").arg("/PID");
1111
command.arg(target_process_id.to_string());

docs/bench.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
windows kill-tree
2+
target/release/kill_tree_cli.exe <process_id>
3+
4+
windows taskkill
5+
C:\WINDOWS\system32\taskkill.exe /F /T /PID <process_id>
6+
7+
platform: windows, arch: x86_64, exe: target/release/kill_tree_cli.exe, count: 100, total_ms: 1616, average_ms: 16
8+
platform: windows, arch: x86_64, exe: C:\WINDOWS\system32\taskkill.exe, count: 100, total_ms: 6167, average_ms: 61
9+
10+
platform: windows, arch: x86_64, exe: target/release/kill_tree_cli.exe, count: 200, total_ms: 2635, average_ms: 13
11+
platform: windows, arch: x86_64, exe: C:\WINDOWS\system32\taskkill.exe, count: 200, total_ms: 13425, average_ms: 67
12+
13+
platform: windows, arch: x86_64, exe: target/release/kill_tree_cli.exe, count: 300, total_ms: 4427, average_ms: 14
14+
platform: windows, arch: x86_64, exe: C:\WINDOWS\system32\taskkill.exe, count: 300, total_ms: 22351, average_ms: 74
15+
16+
```sh
17+
# wmic cpu get NumberOfCores,NumberOfLogicalProcessors
18+
NumberOfCores NumberOfLogicalProcessors
19+
8 16
20+
```
21+
22+
```sh
23+
# systeminfo | findstr /C:"Total Physical Memory"
24+
Total Physical Memory: 16,270 MB
25+
```
26+
27+
```sh
28+
# systeminfo | findstr /B /C:"OS Name" /B /C:"OS Version"
29+
OS Name: Microsoft Windows 11 Pro
30+
OS Version: 10.0.22621 N/A Build 22621
31+
```
32+
33+
```sh
34+
# rustc -vV
35+
rustc 1.78.0-nightly (1a648b397 2024-02-11)
36+
binary: rustc
37+
commit-hash: 1a648b397dedc98ada3dd3360f6d661ec2436c56
38+
commit-date: 2024-02-11
39+
host: x86_64-pc-windows-msvc
40+
release: 1.78.0-nightly
41+
LLVM version: 17.0.6
42+
```

docs/dev.md

Lines changed: 4 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,15 @@ OS Version: 10.0.22621 N/A Build 22621
1616

1717
```sh
1818
# rustc -vV
19-
rustc 1.75.0 (82e1608df 2023-12-21)
19+
rustc 1.78.0-nightly (1a648b397 2024-02-11)
2020
binary: rustc
21-
commit-hash: 82e1608dfa6e0b5569232559e3d385fea5a93112
22-
commit-date: 2023-12-21
21+
commit-hash: 1a648b397dedc98ada3dd3360f6d661ec2436c56
22+
commit-date: 2024-02-11
2323
host: x86_64-pc-windows-msvc
24-
release: 1.75.0
24+
release: 1.78.0-nightly
2525
LLVM version: 17.0.6
2626
```
2727

28-
#### Local Build Command
29-
30-
```sh
31-
cargo build --target=x86_64-pc-windows-msvc
32-
```
33-
3428
### Linux
3529

3630
#### Host Information
@@ -64,12 +58,6 @@ sudo apt install lld
6458
rustup target add x86_64-unknown-linux-musl
6559
```
6660

67-
#### Local Build Command
68-
69-
```sh
70-
cargo build --target=x86_64-unknown-linux-musl
71-
```
72-
7361
### Macos
7462

7563
#### Host Information
@@ -99,24 +87,6 @@ release: 1.75.0
9987
LLVM version: 17.0.6
10088
```
10189

102-
#### Requirements
103-
104-
```sh
105-
brew install llvm
106-
```
107-
108-
after install
109-
110-
```sh
111-
echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' >> ~/.zshrc
112-
```
113-
114-
#### Local Build Command
115-
116-
```sh
117-
cargo build --target=aarch64-apple-darwin
118-
```
119-
12090
# Test environment
12191

12292
## Requirements
@@ -134,33 +104,3 @@ Please ensure `node` command.
134104
# node --version
135105
v20.11.0
136106
```
137-
138-
# Deployment environment
139-
140-
## Host Platform Architecture
141-
142-
Macos Apple Silicon
143-
144-
## Command
145-
146-
```sh
147-
# Common
148-
RUSTFLAGS="-C target-feature=+crt-static"
149-
150-
# Linux
151-
rustup target add x86_64-unknown-linux-musl
152-
brew install filosottile/musl-cross/musl-cross
153-
cargo build --target=x86_64-unknown-linux-musl
154-
155-
# Windows
156-
rustup target add x86_64-pc-windows-msvc
157-
cargo install cargo-xwin
158-
cargo xwin build --target x86_64-pc-windows-msvc
159-
160-
# Macos
161-
rustup target add x86_64-apple-darwin
162-
rustup target add aarch64-apple-darwin
163-
cargo install cargo-zigbuild
164-
brew install zig
165-
cd cli && cargo zigbuild --target universal2-apple-darwin
166-
```

0 commit comments

Comments
 (0)