go-find-dated

command module
v0.0.0-...-20c84aa Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2025 License: MIT Imports: 11 Imported by: 0

README

= go-find-dated

Find files based on the date in filename. Go version of
https://github.com/denarced/find-dated[denarced/find-dated].

== Usage

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.

== Motivation

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
https://github.com/denarced/find-dated[denarced/find-dated] repository. The
approximate durations were measured with
https://github.com/sharkdp/hyperfine[sharkdp/hyperfine], all durations in
milliseconds.

[cols="<,>,>,>,>"]
|===
| Command                                                         | mean  | standard deviation | min  | max

| https://github.com/denarced/find-dated[denarced/find-dated]     | 1,346 | 136                | 1095 | 1638
| This                                                            |   183 |  24                |  155 |  231
| https://www.gnu.org/software/findutils/[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

Documentation

Overview

Find files based on dates in filenames.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL