1

find is sometimes a bit slow for large directories. This can sometimes be resolved by excluding files and directories.

Is there a version of find that supports caching for better performance. Similar to ctags but for the details about their files rather than their content.

Related:

Att Righ
  • 1,439
  • 1
  • 16
  • 29

1 Answers1

1

find already does use caching.

Edit: Actually I don't know what it does but the first time you run the command is slower than the rest. Perhaps it's just indicing.

Siamaster
  • 941
  • 12
  • 19
  • Hmm, how come `locate` is faster than `find`? – Att Righ Nov 19 '21 at 11:24
  • 1
    I have no idea but if you run the same find command several times, the first run will be slower than the rest. – Siamaster Nov 19 '21 at 11:28
  • 1
    Hmm... yeah the inodes for the find will probably be kept cached to improve performance. I guess locate mind be creating *indexes* for some forms of searching. – Att Righ Nov 19 '21 at 11:29
  • 1
    I was just gonna say, perhaps find uses indicing and not caching. – Siamaster Nov 19 '21 at 11:30
  • I think the answer might be "find can't be made faster, only certain operations with indexes". I guess you might be able to sort of copy all the inode information for all the subdirectories into one big file to improve performance. – Att Righ Nov 19 '21 at 11:42
  • @Simaster "perhaps find uses indicing not caching" do you mean locate or find? – Att Righ Nov 19 '21 at 11:43
  • I meant find. But it doesn't really matter since I also said "perhaps". It means I know nothing :) sorry – Siamaster Nov 20 '21 at 20:14