Skip to content

Releases: charlievieth/fastwalk

v1.0.8 Fix go1.20 build

18 Jul 15:00
Compare
Choose a tag to compare

v1.0.8

commit 1fb2d4d
Author: Charlie Vieth [email protected]
Date: Thu Jul 18 10:00:29 2024 -0400

fix go 1.20 build and retract v1.0.7

This commit fixes the build for Go 1.20 by removing use of the slices
package and retracts the v1.0.7 release.

It also changes the CI to test go1.20 (our minimum supported version)
so that this will not happen again in the future.

v1.0.7 Add optional sorting and automatically detect if forward slashes should be used

18 Jul 03:58
Compare
Choose a tag to compare

v1.0.7

This release changes the detection for ToSlash on Windows to only check is the "MSYSTEM" environment variable is set and removes the detection for Windows Subsystem on Linux (WSL) since it was unreliable (additionally tools like fd do not attempt to detect if running under WSL).

It also adds a new feature: the ability to sort directory entries before being processed. This does not make the order that directories and files are visited globally deterministic, but it does significantly improve the output Walk and is useful for tools that print said output.

commit 861d712
Author: Charlie Vieth [email protected]
Date: Thu Jul 11 00:39:35 2024 -0400

fastwalk: add optional sorting and improve documentation

This commit adds the new SortMode and Config.Sort setting to sort
a directory's entries before they are processed. This does not make
the global order that directories and entries are visited
non-deterministic but it does help make the output a bit saner compared
to the default directory order. This was added to make the output of FZF
a bit nicer.

This commit also improves documentation and comments of exported
functions.

commit 875daa3
Author: Charlie Vieth [email protected]
Date: Tue Jul 16 12:50:55 2024 -0400

fastwalk: only check if MSYSTEM is set during MSYS/MSYS2

This changes the MSYS/MSYS2 detection to only check if the MSYSTEM
environment variable is set instead of asserting on its value. This
is to support other MSYS environments like UCRT64.

It also removes the check for Windows Subsystem for Linux (WSL) since
it was unreliable and required us to stat and potentially read a file
on initialization (which is bad).

See:
 * https://github.com/charlievieth/fastwalk/commit/87029d9318159fb714bd064bbda22d69a11fa9f2#r144282929
 * https://github.com/sharkdp/fd/commit/f875ea9a5

commit 87029d9
Author: Charlie Vieth [email protected]
Date: Wed Jul 3 14:59:17 2024 -0400

fastwalk: add MSYS/MSYS2 detection to DefaultToSlash

This change updates DefaultToSlash to also check if we're running in a
MSYS/MSYS2 enviroment since they also use forward slashes.

v1.0.6: fix go1.20 build

03 Jul 07:06
Compare
Choose a tag to compare

v1.0.6

commit 3ec5a9e
Author: Charlie Vieth [email protected]
Date: Wed Jul 3 02:58:43 2024 -0400

fastwalk: remove use of go1.21 features

fastwalk: remove use of go1.21 features to fix fzf build

v1.0.5: add ToSlash option and replace getdirentries64 with readdir_r on macOS

03 Jul 06:17
Compare
Choose a tag to compare

v1.0.5

commit 0446dfe
Author: Charlie Vieth [email protected]
Date: Wed Jul 3 01:21:34 2024 -0400

fastwalk: add ToSlash option for enforcing forward-slash paths

This commit adds the Config.ToSlash option which forces paths to be
joined with a forward-slash instead of the default OS path separator.
This mostly applies to Go binaries that are compiled for Windows but
run under the Windows Subsystem for Linux (WSL) so this commit also
adds a helper function DefaultToSlash which detects if we're a Windows
exe running in WSL.

commit 22a282e (master)
Author: Charlie Vieth [email protected]
Date: Tue Jul 2 15:00:22 2024 -0400

mod: update go version to 1.20

commit d4d0d43
Author: Charlie Vieth [email protected]
Date: Sat Jun 29 15:36:06 2024 -0400

dirent: handle nil DirEntry in StatDirEntry

commit ca81468
Author: Charlie Vieth [email protected]
Date: Tue Jul 2 14:22:14 2024 -0400

gh: test on macos arm64

commit b2d5e56
Author: Charlie Vieth [email protected]
Date: Tue Jul 2 14:12:03 2024 -0400

darwin: cleanup syscall code and use a fixed buffer for opendir

Remove unused syscall code and use a fixed buffer for opendir which
saves us an alloc.

commit e515b65
Author: Charlie Vieth [email protected]
Date: Sat Jun 22 01:10:08 2024 -0400

darwin: replace getdirentries64 with readdir_r

The performance benefit of getdirentries64 was negligible to
non-existent and added a huge support burden code wise.

v1.0.4 unix fix stat on unknown file type

18 Jun 15:00
Compare
Choose a tag to compare

v1.0.4

commit 78ddd19 (HEAD -> master, origin/master)
Author: Jan Palus [email protected]
Date: Mon Jun 17 15:55:32 2024 +0200

unix: fix stat on unknown file type

make sure `unknownFileMode` const value matches what is returned when
file type failed to be determmined

commit 9e83309
Author: Charlie Vieth [email protected]
Date: Sat Apr 6 01:25:18 2024 -0400

fastwalk: save a call to Stat when following links

This also changes the code to immediately check if root exists.

commit 386c69b
Author: Charlie Vieth [email protected]
Date: Sat Apr 6 01:07:16 2024 -0400

mod: remove empty go.sum file

commit f3655c0
Author: Charlie Vieth [email protected]
Date: Sat Apr 6 01:01:58 2024 -0400

all: reconcile build tags with internal/dirent package and test builds

This mostly fixes the cluster fuck of build directives and reconciles
them to match the Unix platforms supported by internal/dirent + darwin
it also removes the appengine crap that was a legacy of the original
code.

v1.0.3: Fix Unix/Darwin dirent parsing bugs

04 Apr 04:08
Compare
Choose a tag to compare

v1.0.3

commit 9cba5f4
Author: Charlie Vieth [email protected]
Date: Wed Apr 3 23:58:15 2024 -0400

fastwalk: add new dirent package for parsing Unix dirents

This commit updates the Dirent parsing logic to match what the go1.22
stdlib uses.

This is an attempt to fix FZF issue:
https://github.com/junegunn/fzf/issues/3706

commit 596420e
Author: Charlie Vieth [email protected]
Date: Wed Apr 3 23:39:05 2024 -0400

darwin: use pointer offsets to access dirent fields with getdirentries64

This fixes the "converted pointer straddles multiple allocations" errors
reported by the race-detector when using getdirentries64 on darwin by
changing the dirent parsing logic to match that of golang.org/x/sys/unix.

v1.0.2: fix go build for solaris/illumos

17 Feb 06:47
999f7a6
Compare
Choose a tag to compare

v1.0.2

commit 999f7a6
Author: Charlie Vieth [email protected]
Date: Sat Feb 17 01:40:11 2024 -0500

gh: update tested go versions and remove CodeQL since we have no deps

commit 538e4d9
Author: Charlie Vieth [email protected]
Date: Sat Feb 17 01:31:48 2024 -0500

tests: remove godirwalk test dependency

godirwalk was only included for comparative bench tests and IMHO we're
fast enough now to ignore it

commit 85141d4
Author: Charlie Vieth [email protected]
Date: Sat Feb 17 01:15:51 2024 -0500

README: fix typo

commit 7d77a65
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date: Wed Mar 15 17:24:08 2023 +0000

build(deps): bump actions/setup-go from 3 to 4

Bumps [actions/setup-go](https://github.com/actions/setup-go) from 3 to 4.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

commit 2f23cea
Author: Aaron Brady [email protected]
Date: Fri Feb 16 22:31:09 2024 +0000

fix go build for solaris/illumos

commit 5afcbbf
Author: Charlie Vieth [email protected]
Date: Tue Aug 30 09:22:59 2022 -0400

all: remove use of io/ioutil and make golangci-lint happy

commit 55d8fe0
Author: Charlie Vieth [email protected]
Date: Tue Aug 30 09:16:40 2022 -0400

gh: run tests with go1.18 and go1.19

commit 1be8b54
Author: Charlie Vieth [email protected]
Date: Tue Aug 30 09:15:25 2022 -0400

all: format source for go1.19

commit 99ba27a
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sun Aug 7 20:30:17 2022 +0000

build(deps): bump github/codeql-action from 1 to 2

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1 to 2.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

commit f85fea4
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sun Aug 7 20:30:19 2022 +0000

build(deps): bump actions/setup-go from 2 to 3

Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2 to 3.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

commit f57e249
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sun Aug 7 20:30:21 2022 +0000

build(deps): bump actions/checkout from 2 to 3

Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

v1.0.1: update modules and Windows fixes

07 Aug 20:31
6d6fd97
Compare
Choose a tag to compare

v1.0.1

commit 6d6fd97
Author: Charlie Vieth [email protected]
Date: Sun Aug 7 16:29:50 2022 -0400

gh: update dependabot workflow

commit 429103f
Author: Charlie Vieth [email protected]
Date: Sun Aug 7 16:29:04 2022 -0400

mod: update github.com/karrick/godirwalk to v1.17.0

commit a695f72
Author: Charlie Vieth [email protected]
Date: Tue Apr 5 15:32:20 2022 -0600

git: ignore *.test files

commit b5108dc
Author: Charlie Vieth [email protected]
Date: Tue Apr 5 15:31:03 2022 -0600

git: ignore vendor directory

commit 298d1b2
Author: Charlie Vieth [email protected]
Date: Thu Mar 3 17:56:46 2022 -0500

README: add Windows benchmarks

commit ca3096c
Author: Charlie Vieth [email protected]
Date: Thu Mar 3 17:45:17 2022 -0500

EntryFilter: add long path tests for Windows

commit 5de043e
Author: Charlie Vieth [email protected]
Date: Wed Mar 2 23:31:12 2022 -0500

README/scripts: add script to check if binary links to getdirentries

commit 63ef0f1
Author: Charlie Vieth [email protected]
Date: Wed Mar 2 22:35:54 2022 -0500

README: re-order links

v1.0.0 initial release

03 Mar 03:34
2eb2d27
Compare
Choose a tag to compare

v1.0.0

This is the initial release of github.com/charlievieth/fastwalk.

commit 2eb2d27
Author: Charlie Vieth [email protected]
Date: Wed Mar 2 22:14:37 2022 -0500

README: update and add examples

commit 0d4cb3e
Author: Charlie Vieth [email protected]
Date: Wed Mar 2 20:22:01 2022 -0500

darwin: implement readdir_r and closedir instead of linking to the stdlib

commit 1d9075e
Author: Charlie Vieth [email protected]
Date: Wed Mar 2 20:15:58 2022 -0500

README: update with new Darwin perf numbers (now 2x faster)

commit 5daeaef
Author: Charlie Vieth [email protected]
Date: Wed Mar 2 20:09:16 2022 -0500

Correctly follow symlinks, fix adapter funcs, fix Windows tests

This also tunes DefaultNumWorkers for macOS/Darwin which results in a
22% speed up:
```
name         old time/op    new time/op    delta
FastWalk-10    16.8ms ± 1%    13.0ms ± 2%  -22.20%  (p=0.008 n=5+5)

name         old alloc/op   new alloc/op   delta
FastWalk-10    2.13MB ± 0%    2.14MB ± 0%     ~     (p=0.151 n=5+5)

name         old allocs/op  new allocs/op  delta
FastWalk-10     37.7k ± 0%     37.7k ± 0%   -0.01%  (p=0.016 n=5+5)
```

commit 8d5c8bb
Author: Charlie Vieth [email protected]
Date: Wed Mar 2 11:51:36 2022 -0500

README: update and add example

commit a206b5c
Author: Charlie Vieth [email protected]
Date: Fri Feb 25 20:22:26 2022 -0500

export StatDirEntry

The StatDirEntry can be used to get the results of os.Stat for a
DirEntry.

commit f0398be
Author: Charlie Vieth [email protected]
Date: Fri Feb 25 19:52:28 2022 -0500

unix: uncomment line in test

commit cec9408
Author: Charlie Vieth [email protected]
Date: Fri Feb 25 19:41:52 2022 -0500

remove unused testdata folder

commit 77fe7e3
Author: Charlie Vieth [email protected]
Date: Fri Feb 25 19:35:38 2022 -0500

unix: consolidate unix (non-macOS) specific files

commit abcbda0
Author: Charlie Vieth [email protected]
Date: Fri Feb 25 19:29:37 2022 -0500

linux: speed up direntNamlen

commit 7c6327a
Author: Charlie Vieth [email protected]
Date: Fri Feb 25 17:14:37 2022 -0500

Use fs.DirEntry and fs.FileInfo instead of os.DirEntry and os.FileInfo

commit 674cbf6
Author: Charlie Vieth [email protected]
Date: Fri Feb 25 17:10:45 2022 -0500

darwin: improve readDir test coverage

commit 128e4e1
Author: Charlie Vieth [email protected]
Date: Fri Feb 25 16:49:57 2022 -0500

dirent: cache Stat results for portableDirent

commit a4a3f4b
Author: Charlie Vieth [email protected]
Date: Fri Feb 25 16:10:26 2022 -0500

tests: fix TestEntryFilter on Windows

commit a8a7f0d
Author: Charlie Vieth [email protected]
Date: Thu Feb 24 22:35:39 2022 -0500

Add README

commit 1e61d29
Author: Charlie Vieth [email protected]
Date: Thu Feb 24 20:44:39 2022 -0500

EntryFilter: use multiple entry stores to reduce lock contention

```
benchmark                                      old ns/op     new ns/op     delta
BenchmarkEntryFilter_Seen-10                   30.8          33.4          +8.41%
BenchmarkEntryFilter_Seen_Parallel-10          130           60.4          -53.58%
BenchmarkEntryFilter/MostlyHits-10             41.7          48.6          +16.51%
BenchmarkEntryFilter/MostlyHitsParallel-10     132           71.2          -45.89%
BenchmarkEntryFilter/HalfMisses-10             115           135           +17.54%
```

commit 4e8a8c4
Author: Charlie Vieth [email protected]
Date: Thu Feb 24 20:39:53 2022 -0500

Makefile: only run nogetdirentries test on darwin

commit d9fb580
Author: Charlie Vieth [email protected]
Date: Thu Feb 24 20:38:39 2022 -0500

Makefile: fix bench_comp target

commit 62ed6f4
Author: Charlie Vieth [email protected]
Date: Wed Feb 23 13:32:23 2022 -0500

rename seen_* entry_filter_*

commit 221012d
Author: Charlie Vieth [email protected]
Date: Wed Feb 23 12:21:47 2022 -0500

darwin: fixup build tags on zsyscall_*getdirentries* files

commit a3a6465
Author: Charlie Vieth [email protected]
Date: Wed Feb 23 12:19:32 2022 -0500

remove lstatDirent as it's no longer needed since we cache the result

commit 2e6a1b8
Author: Charlie Vieth [email protected]
Date: Tue Feb 22 17:08:59 2022 -0500

Add Makefile and benchmark script

commit 2940440
Author: Charlie Vieth [email protected]
Date: Tue Feb 22 14:53:41 2022 -0500

benchmark fastwalk against filepath.WalkDir and godirwalk.Walk

Below results from a 2021 M1 MacBook Pro.

filepath vs. fastwalk:
```
name               old time/op    new time/op    delta
WalkComparison-10    30.8ms ± 0%    17.4ms ± 1%  -43.43%  (p=0.008 n=5+5)

name               old alloc/op   new alloc/op   delta
WalkComparison-10    4.33MB ± 0%    2.14MB ± 0%  -50.64%  (p=0.008 n=5+5)

name               old allocs/op  new allocs/op  delta
WalkComparison-10     50.9k ± 0%     37.7k ± 0%  -26.00%  (p=0.008 n=5+5)
```

godirwalk vs. fastwalk:
```
name               old time/op    new time/op    delta
WalkComparison-10    59.2ms ± 1%    17.4ms ± 1%  -70.63%  (p=0.008 n=5+5)

name               old alloc/op   new alloc/op   delta
WalkComparison-10    25.2MB ± 0%     2.1MB ± 0%  -91.54%  (p=0.008 n=5+5)

name               old allocs/op  new allocs/op  delta
WalkComparison-10     57.6k ± 0%     37.7k ± 0%  -34.58%  (p=0.016 n=4+5)
```

commit 581a6f5
Author: Charlie Vieth [email protected]
Date: Tue Feb 22 14:19:40 2022 -0500

darwin: don't export Getdirentries function

commit e64e8db
Author: Charlie Vieth [email protected]
Date: Tue Feb 22 14:16:24 2022 -0500

DirEntry: cache results on unix and ensure fastwalk.DirEntry is always used

This commit changes the unix DirEntry implementation to cache the
results of Info() and Stat(). It also ensures that the fs.DirEntry
passed to WalkFunc is always a fastwalk.DirEntry, which has an extra
Stat() method.

commit 69596e8
Author: Charlie Vieth [email protected]
Date: Sat Jan 29 02:34:45 2022 -0500

fastwalk: skip ErrPermission test on Windows

TODO: create an applicable test for Windows

commit cffabdf
Author: Charlie Vieth [email protected]
Date: Sat Jan 29 02:16:20 2022 -0500

github: remove go1.16 target

commit 56652af
Author: Charlie Vieth [email protected]
Date: Sat Jan 29 02:14:16 2022 -0500

github: add workflows for Linux, macOS, and Windows

commit cecff90
Author: Charlie Vieth [email protected]
Date: Sat Jan 29 00:25:33 2022 -0500

add MIT LICENSE and reference Go's LICENSE

commit 5c62e67
Author: Charlie Vieth [email protected]
Date: Sat Jan 29 00:09:35 2022 -0500

darwin: use getdirentries64 for readDir

Use getdirentries64 for readDir since it reduces the number of syscalls.
Since getdirentries64 is deprecated and banned by the App Store the
'nogetdirentries' build tag can be used to omit its usage and linkage.

commit 5843c3c
Author: Charlie Vieth [email protected]
Date: Fri Jan 28 22:21:16 2022 -0500

convert Walk() to take a fs.WalkDirFunc

commit 576d1db
Author: Charlie Vieth [email protected]
Date: Thu Jan 27 19:55:40 2022 -0500

initial commit