4 ms·
Here is one example of why I think Date is broken: For quite awhile (maybe still?) calling `new Date()` made a synchronized call to a static method to try and
by mbell 13y ago
Here is one example of why I think Date is broken:
For quite awhile (maybe still?) calling `new Date()` made a synchronized call to a static method to try and figure out the default timezone. That created nasty lock contention in multithreaded code, nuking performance. Of course there is no way to create a new Date with a particular time zone. The other option was using the Calendar class since you could pass in a time zone, but a Calendar takes ~20 times more memory and is slow as hell to create. This meant you couldn't do something as simple as creating new Date classes with reasonable performance.