Speed up a bit port version by caching directory subdir