Find files based on the date in filename. Go version of denarced/find-dated.
See the aforementioned find-dated to get an idea on how to use. Behavior should be identical except for error handling which hasn’t been implemented in this Go version.
This was written merely in order to see how much performance would improve if find-dated was written with Go and parallelism was utilized to the extreme. Performance did in fact improve significantly. The test involved a directory with 2601 subdirectories and 67200 files. They were created with a script in denarced/find-dated repository. The approximate durations were measured with sharkdp/hyperfine, all durations in milliseconds.
Command | mean | standard deviation | min | max |
---|---|---|---|---|
1,346 |
136 |
1095 |
1638 |
|
This |
183 |
24 |
155 |
231 |
find directory -type f |
105 |
7 |
94 |
117 |
GNU find was included to have a comparison against a really fast implementation, albeit one that’s probably single threaded.
The tests were performed on a Dell XPS 13 laptop with the following specs:
-
Ubuntu 22.04.3 64bit
-
Intel i7-8550U 1.80GHz
-
16GB
-
Samsung PM981 NVMe 512GB
-
ext4 filesystem