pytest-dev/pytest-cpp

Check if files are executable before forwarding them to the facades

nicoddemus opened this issue · 1 comments

Use os.stat(filename).st_mode & stat.S_IXUSR to speed that up, including doing that before fnmatch.

Hmmm not quite:

$ python -m timeit -s "import fnmatch" "fnmatch.fnmatch('tests/boost_success.exe', 'test*')"
1000000 loops, best of 3: 1.87 usec per loop
python -m timeit -s "import os,stat" "os.stat('tests/boost_success.exe').st_mode & stat.S_IXUSR"
100000 loops, best of 3: 4.47 usec per loop