Open othyn opened 4 years ago
Also, in its current implementation, it is 'caching' and reusing the instance of DateFormatter within the scope of the file, but this can be expanded and maybe instead provide an extension of DateFormatter to return a static instance for these to use?
Benchmarks and advice still overwhelmingly recommend caching DateFormatter for large speed improvements, anywhere from 5x to 20x.
To some extent, it appears you can abuse Swift's handling of static computed properties to implement this.