Skip to content

Commit 2d1fbcd

Browse files
chore: ⚙️ add benchmarks
Co-authored-by: Parth Jadhav <[email protected]>
1 parent 076a93d commit 2d1fbcd

File tree

1 file changed

+33
-3
lines changed

1 file changed

+33
-3
lines changed

README.md

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Blazingly fast file search library built in Rust 🔥 [Work in progress]
44

55
[![Version info](https://img.shields.io/crates/v/rust_search.svg)](https://crates.io/crates/rust_search)
66

7-
## Usage
7+
## 📦 Usage
88

99
Please report any problems you encounter when using rust search here: [Issues](https://github.com/ParthJadhav/rust_search/issues)
1010

@@ -47,15 +47,45 @@ use rust_search::Search;
4747
Search::new("/path/to/directory", None, None, Some(1));
4848
```
4949

50-
### Discord Server
50+
## ⚙️ Benchmarks
51+
The difference in sample size is due to the fact that fd and glob are different tools and have different use cases. fd is a command line tool that searches for files and directories. glob is a library that can be used to search for files and directories. The benchmark is done on a MacBook Air M2, 16 GB Unified memory.
52+
53+
Benchmarks are done using [hyperfine](https://github.com/sharkdp/hyperfine),
54+
Benchmarks files are available in the [benchmarks](https://drive.google.com/drive/folders/1ug6ojNixS5jAe6Lh6M0o2d3tku73zQ9w?usp=sharing) drive folder.
55+
### - Rust vs Glob
56+
The benchmark was done on a directories containing 300K files.
57+
58+
| Command / Library | Mean [s] | Min [s] | Max [s] | Relative |
59+
|:---|---:|---:|---:|---:|
60+
| `rust_search` | 1.317 ± 0.002 | 1.314 | 1.320 | 1.00 |
61+
| `glob` | 22.728 ± 0.023 | 22.690 | 22.746 | 17.25 ± 0.03 |
62+
63+
---
64+
### - Rust vs FD
65+
The benchmark was done on a directories containing 45K files.
66+
67+
| Command / Library | Mean [ms] | Min [ms] | Max [ms] | Relative |
68+
|:---|---:|---:|---:|---:|
69+
| `rust_search` | 680.5 ± 2.1 | 678.3 | 683.6 | 1.00 |
70+
| `fd -e .js` | 738.7 ± 10.2 | 720.8 | 746.7 | 1.09 ± 0.02 |
71+
72+
---
73+
74+
### Results:-
75+
```diff
76+
+ Rust_Search is 17.25 times faster than Glob.
77+
78+
+ Rust_Search** is 1.09 times faster than FD.
79+
```
80+
5181
## 🔵 Discord server & Linkedin
5282

5383
Click the button below to join the discord server or Linkedin
5484

5585
<a href="https://discord.gg/hqDPyNb9m3" target="_blank"><img src="https://user-images.githubusercontent.com/42001064/126635148-9a736436-5a6d-4298-8d8e-acda11aec74c.png" alt="Join Discord Server" width="180px" ></a>
5686
<a href="https://www.linkedin.com/in/parthjadhav04" target="_blank"><img src="https://img.shields.io/badge/Linkedin-blue?style=flat-square&logo=linkedin" alt="Connect on Linkedin" width="180px" height="58"></a>
5787

58-
## Contributors
88+
## 👨‍💻 Contributors
5989

6090
Any contributions would be greatly valued as this library is still in its early stages.
6191

0 commit comments

Comments
 (0)