Getting array of folder names in a directory very slow

I put together an example project for you, modified from this post: