3 ms·
“A reimplementation of Calendar in Swift is 1.5x to 18x as fast as the C one (calling from Swift in various synthetic benchmarks like creation, date calculation
by hyperhello 4y ago
“A reimplementation of Calendar in Swift is 1.5x to 18x as fast as the C one (calling from Swift in various synthetic benchmarks like creation, date calculation).”
I’m sure it is, but this is not solving the right problem at all. Calendar is all UI. It needs to be lovingly gone over, not this.
- stephencanon 4y agoThat quote is talking about the Foundation type named Calendar (https://developer.apple.com/documentation/foundation/calendar https://developer.apple.com/documentation/foundation/calenda...), not Calendar.app.
- newZWhoDis 4y agoCalendar/Date is the foundation for all time handling in iOS apps. If you see a string with a date in it it was probably handled by this system.
- jeremy_wiebe 4y agoThis post is referring to NSCalendar and Swift's Calendar class. > NSCalendar objects encapsulate information about systems of reckoning time in which the beginning, length, and divisions of a year are defined. > The Swift overlay to the Foundation framework provides the Calendar structure, which bridges to the NSCalendar class. https://developer.apple.com/documentation/foundation/nscalendar https://developer.apple.com/documentation/foundation/nscalen...
- mpweiher 4y agoNote the somewhat disingenuous performance claim: The reimplementation itself is not 1.5x to 18x as fast as the C one. It is calling from Swift that is faster. Yes, they correct in the parenthesis, but that's not how parenthetical expressions work: A parenthetical expression is extra information added to a sentence or question that clarifies, explains, or adds information without changing the basic meaning. Think of it as an aside providing readers with helpful information that they don’t absolutely have to have, but that is helpful to them. https://grammar.yourdictionary.com/style-and-usage/parenthetical-expression-types-and-usage.html https://grammar.yourdictionary.com/style-and-usage/parenthet... So basically, they are fixing the problem they've been having with bridging performance, which of course is due purely to them mis-designing Swift in such a way that it doesn't bridge well with all the existing code they have.
- dev_tty01 4y agoNo, I think you are misunderstanding the parenthetical claim. They are still benchmarking the actual reimplementation, they are just parenthetically pointing out that the reimplementations are being called from Swift, not Obj-C. The reimplementation itself is 1.5x to 18x. They are using the parenthetical in precisely the way the style and usage guide suggests, adding the additional information that the new implementation is called from Swift.