Optimize typed arrays