Skip to content

Commit

Permalink
docs: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
oneofthezombies committed Feb 12, 2024
1 parent 2b8ed88 commit 3f570dc
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ This project was inspired by [node-tree-kill](https://github.com/pkrumins/node-t

The reason I created this is because I have a case where I need to stop grandchild processes.
This is because the way to kill a grandchild process on the Windows platform is to use the `Win32` API to determine the process relationship and either kill them all (Kill Tree's implementation) or call the `taskkill` program.
Even my program is more than __3x faster__ than `taskkill`.
Even my program is more than __3-5x faster__ than `taskkill`. (see [bench](docs/bench.md))

---

Expand Down
48 changes: 35 additions & 13 deletions docs/bench.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,60 @@
windows kill-tree
target/release/kill_tree_cli.exe <process_id>
# Kill Tree vs Taskkill

windows taskkill
C:\WINDOWS\system32\taskkill.exe /F /T /PID <process_id>
## Results

platform: windows, arch: x86_64, exe: target/release/kill_tree_cli.exe, count: 100, total_ms: 1616, average_ms: 16
platform: windows, arch: x86_64, exe: C:\WINDOWS\system32\taskkill.exe, count: 100, total_ms: 6167, average_ms: 61
faster 3.816212871287129x
| App | Kill Count | Total (ms) | Average (ms) | Faster Than Taskkill |
| --- | --- | --- | --- | --- |
| Kill Tree | 100 | 1616 | 16 | 3.8x |
| taskkill | 100 | 6167 | 61 | 1x |

platform: windows, arch: x86_64, exe: target/release/kill_tree_cli.exe, count: 200, total_ms: 2635, average_ms: 13
platform: windows, arch: x86_64, exe: C:\WINDOWS\system32\taskkill.exe, count: 200, total_ms: 13425, average_ms: 67
faster 5.094876660341556x
| App | Kill Count | Total (ms) | Average (ms) | Faster Than Taskkill |
| --- | --- | --- | --- | --- |
| Kill Tree | 200 | 2635 | 13 | 5x |
| taskkill | 200 | 13425 | 67 | 1x |

platform: windows, arch: x86_64, exe: target/release/kill_tree_cli.exe, count: 300, total_ms: 4427, average_ms: 14
platform: windows, arch: x86_64, exe: C:\WINDOWS\system32\taskkill.exe, count: 300, total_ms: 22351, average_ms: 74
faster 5.048791506663655x
| App | Kill Count | Total (ms) | Average (ms) | Faster Than Taskkill |
| --- | --- | --- | --- | --- |
| Kill Tree | 300 | 4427 | 14 | 5x |
| taskkill | 300 | 22351 | 74 | 1x |

## Executable

### Kill Tree

build: `cargo build --package kill_tree_cli --bins --release`
executable: `target/release/kill_tree_cli.exe` <process_id>

### Taskkill

excutable: `C:\WINDOWS\system32\taskkill.exe /F /T /PID` <process_id>

## Environment

### CPU

```sh
# wmic cpu get NumberOfCores,NumberOfLogicalProcessors
NumberOfCores NumberOfLogicalProcessors
8 16
```

### Memory

```sh
# systeminfo | findstr /C:"Total Physical Memory"
Total Physical Memory: 16,270 MB
```

### OS Version

```sh
# systeminfo | findstr /B /C:"OS Name" /B /C:"OS Version"
OS Name: Microsoft Windows 11 Pro
OS Version: 10.0.22621 N/A Build 22621
```

### Rust Compiler Version

```sh
# rustc -vV
rustc 1.78.0-nightly (1a648b397 2024-02-11)
Expand Down

0 comments on commit 3f570dc

Please sign in to comment.