When you quote relative performance, I believe it is important to also provide the absolute performance in order to see the complete picture. While the ASObjC script was 10X faster than the
find shell script, the actual times, per Script Geek (10 trials)
- ASObjC: 0.001 sec
From an end-users perspective, 0.008 sec is nothing, even if it is 10X.
Even when I use
find to search 30,000 files for text within the name, the performance is very, very acceptable at 0.136 sec. I haven’t tested it, but even if you assume a ASObjC equivalent is 10X with 0.014 sec, again, that is not material to the end user.
I have a lot of tools in my toolkit, and I try to select the one that is best for the job. Sometimes the simpler tool, although a bit slower, is the best for the job. Sometimes, if I need to process 100s of thousands (very very rare) of items, then the more powerful, but more complex, tool is the best tool for the job.
Sorry Shane, but I have to disagree. There are many times I only want the files, or folders, in the parent folder. There are a number of ways to get this, but using
find is a valid, viable option, especially if I can easily change the
find statement to handle a variety of searches. I have already shown that the performance is very, very acceptable. As an example:
set cmdStr to "find \"" & folderToSearch & ¬
"\" " & subFoldersToSearch & ¬
" -iname \"" & ptyKeyWord & "\""
set filePathList to paragraphs of (do shell script cmdStr)
Shane, I think it may be hard for you to fully appreciate that because you understand ASObjC and ObjC so well, it is near second nature to you. So I understand it being your preferred solution in almost all cases. But some us, at least for me, still find it a very complex and verbose language that has very little support, other than from you and a few others.
Whereas, Bash commands like
find has lots support. It is easy to find solutions/examples on the internet, and the Bash documentation is complete and easy to understand.
As with anything, different users will prefer different tools, have different styles. So be it.
I do really appreciate all the help you give us with ASObjC, from examples, explanations, and the script libraries like mdLib. I would not have any hope of using or understanding ASObjC without this. Thanks again.