-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved the calendar and displayFormatter into static variables and ini…
…tialized them in the +load method. When you've got to format a lot of dates, this greatly improves performance. Getting the shared calender and init'ing a new displayFormatter are both expensive operations.
- Loading branch information
Showing
1 changed file
with
18 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8e80c1a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think using Dependency Injection would allow you to increase performance, while still allowing for thread safety?
8e80c1a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest, I'm not quite sure! Sorry that I haven't responded in so long, I've just been a bit busy. If you've got some spare cycles and you want to give it a shot, I'm more than happy to accept pull requests and try it out. I had some minor correspondence with Mike Ash about this trouble over here in the comments, and he suggested what sounds like a very simple fix (but I just haven't tried it out yet):
8e80c1a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.