This is on OSX:
$ time ruby /tmp/scan.rb .
21953
29899
real 0m3.448s
user 0m0.713s
sys 0m2.712s
$ time ruby /tmp/scan.rb .
21953
29899
real 0m4.728s
user 0m0.747s
sys 0m3.948s
Interestingly Python find a few more files and dirs, I suspect the semantic of Dir.Entry.is_dir()
doesn't quite match File.directory?
$ time python3 /tmp/scan.py .
22655
29905
real 0m1.118s
user 0m0.367s
sys 0m0.729s
$ time python3 /tmp/scan.py .
22655
29905
real 0m1.123s
user 0m0.371s
sys 0m0.737s