-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: replace minimatch with fast-glob (#126)
`fast-glob` is indeed fast. When running Helia's add-dir benchmark: Before: ``` ┌─────────┬───────────────────────────┬──────────┬──────────┬──────┬──────────┬──────────────────────────────────────────────────┐ │ (index) │ Implementation │ ops/s │ ms/op │ runs │ p99 │ CID │ ├─────────┼───────────────────────────┼──────────┼──────────┼──────┼──────────┼──────────────────────────────────────────────────┤ │ 0 │ 'helia-fs - src' │ '56.95' │ '17.56' │ 5 │ '53.93' │ 'QmY7YuAvtqk9AaMR8mivfyCdSVFT4sJJwLCLYtKYfwAEKf' │ │ 1 │ 'helia-fs - dist' │ '51.74' │ '19.33' │ 5 │ '81.24' │ 'QmdHWaHWXugHHvP2y4SueC1tWUgQBrrzUHUwEMrdNEd7Cn' │ │ 2 │ 'helia-fs - ../gc/src' │ '190.84' │ '5.24' │ 5 │ '21.17' │ 'QmQvJeSxJdCVi8qWwujznXq8Zs2g3gQVNqJUtr9SDUAK9X' │ │ 3 │ 'helia-mem - src' │ '657.37' │ '1.52' │ 5 │ '2.33' │ 'QmY7YuAvtqk9AaMR8mivfyCdSVFT4sJJwLCLYtKYfwAEKf' │ │ 4 │ 'helia-mem - dist' │ '287.28' │ '3.48' │ 5 │ '4.09' │ 'QmdHWaHWXugHHvP2y4SueC1tWUgQBrrzUHUwEMrdNEd7Cn' │ │ 5 │ 'helia-mem - ../gc/src' │ '860.15' │ '1.16' │ 5 │ '1.32' │ 'QmQvJeSxJdCVi8qWwujznXq8Zs2g3gQVNqJUtr9SDUAK9X' │ └─────────┴───────────────────────────┴──────────┴──────────┴──────┴──────────┴──────────────────────────────────────────────────┘ ``` After: ``` ┌─────────┬───────────────────────────┬──────────┬──────────┬──────┬──────────┬──────────────────────────────────────────────────┐ │ (index) │ Implementation │ ops/s │ ms/op │ runs │ p99 │ CID │ ├─────────┼───────────────────────────┼──────────┼──────────┼──────┼──────────┼──────────────────────────────────────────────────┤ │ 0 │ 'helia-fs - src' │ '110.42' │ '9.06' │ 5 │ '35.54' │ 'QmY7YuAvtqk9AaMR8mivfyCdSVFT4sJJwLCLYtKYfwAEKf' │ │ 1 │ 'helia-fs - dist' │ '44.90' │ '22.27' │ 5 │ '96.31' │ 'QmdHWaHWXugHHvP2y4SueC1tWUgQBrrzUHUwEMrdNEd7Cn' │ │ 2 │ 'helia-fs - ../gc/src' │ '121.47' │ '8.23' │ 5 │ '35.53' │ 'QmQvJeSxJdCVi8qWwujznXq8Zs2g3gQVNqJUtr9SDUAK9X' │ │ 3 │ 'helia-mem - src' │ '697.10' │ '1.43' │ 5 │ '1.99' │ 'QmY7YuAvtqk9AaMR8mivfyCdSVFT4sJJwLCLYtKYfwAEKf' │ │ 4 │ 'helia-mem - dist' │ '332.42' │ '3.01' │ 5 │ '3.38' │ 'QmdHWaHWXugHHvP2y4SueC1tWUgQBrrzUHUwEMrdNEd7Cn' │ │ 5 │ 'helia-mem - ../gc/src' │ '852.31' │ '1.17' │ 5 │ '2.06' │ 'QmQvJeSxJdCVi8qWwujznXq8Zs2g3gQVNqJUtr9SDUAK9X' │ └─────────┴───────────────────────────┴──────────┴──────────┴──────┴──────────┴──────────────────────────────────────────────────┘ ``` BREAKING CHANGE: The options type used to extend `minimatch`'s options, now it's `fast-glob`'s options - some field names are different. Windows paths will also be yielded with forward slashes and not backslashes.
- Loading branch information
1 parent
f6f7040
commit bea32ab
Showing
5 changed files
with
50 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// eslint-disable-next-line require-yield | ||
export default async function * glob (): AsyncGenerator<string, void, undefined> { | ||
throw new Error('it-glob does not work in browsers') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters