Optimize code to use native ls seems to be better.