Luc <
n...@no.no> wrote:
> On Fri, 9 Dec 2022 16:04:29 -0000 (UTC), Rich wrote:
>
>> Ralf Fassel <
ral...@gmx.de> wrote:
>
>> And disk IO, esp. if using mechanical disks where seek times dominate
>> for "scan a directory hierarchy" runs, is going to be the ultimate
>> limiting factor. This fact will likely be what would make it appear
>> that a TCL and a /usr/bin/find scan were close in time -- both spent a
>> majority (as in 98%+) of their runtime waiting for disk head seeks to
>> complete.
>>
>> Running on an SSD would remove the seek time overhead, and likely
>> result in /usr/bin/find surpassing a TCL solution by a substantial
>> margin.
>
>
> The disk I/O bottleneck is not very relevant because I am not as concerned
> with how long it's going to take as I am with how much LONGER than `find'
> it's going to take.
If you want to quantify "how much longer" then your only option may be
to run tests. About all any of us can say without actually testing is
"TCL is likely to be slower".
> I intend to release the end product as an application so it's not just for
> me, and people are expected to understand that scanning the entire HD is
> going to take some time. The core of the issue here is whether it's still
> worth trying to do everything in Tcl or I should just accept the facts of
> life and do some [exec find] thing.
Do you plan to make the end product be cross platform (i.e., run on
Linux, Windows, and Mac)? If yes, then you'd want to write it all in
Tcl, even if slower, because there is no equivalent to 'find' on win
(at least not in the default MS install) and while there is one on Mac,
the BSD vs. GNU differences might make for the need for two different
process loops.
> I'm also considering the option of collecting additional data on every
> file such as size, date and permissions, up to the user. For that I would
> feel a lot more comfortable using pure Tcl. The current code has none of
> that but it occurs to me that some people may want it.
GNU find has the ability to output much of this with it's "-print"
option, which might make find even faster than TCL -- but then you /do/
still have to parse the output in TCL, possibly negating the
difference. But that option to find may not exist on Mac, and there is
no 'find' on windows by default.