Batch basename call to improve performance.