What? Since override is support by Swift, it has to be determined at runtime what methods/properties to call, so an indirect call cannot be avoid.
When performance is important, to minimize and help compiler optimization, use private, final access levels to declare methods/properties.
Month: February 2017
Don’t keep instantiating heavy objects
What? Classes like NSDateFormatter, NSCalendar are heavy to instantiate.
How? Create singleton (and it should be thread-safe if the singleton is created properly.)
Tips: If possible, use UNIX epoch (an Int) to represent a date. That speeds up the date object creation (vs. creation by parsing date formatted string.)