Performance tweak to directory index generation