Re:Lightweight API Design in Swift
by skohan on Tuesday November 26, 2019 @05:58AM
(#21637193)
It's also useful to profile your compile times. Sometimes the compiler is spending most of its time on some small sections of code.
For instance, I was working on a project where the use of one library constituted 80% of our compile time! The library allows you to declare autolayout constraints using operator overloads (i.e. `foo.top == container.top - 20`) and apparently the amount of type inference was just murdering our compile times. Changing libraries took this project from being awful to work on to quite pleasant.
Re:Lightweight API Design in Swift
by gbrhaz on Tuesday November 26, 2019 @08:56AM
(#21638251)
Ah, Cartography. Works great in a small project. We ended up moving to standard anchors for almost everything, with some helper methods to handle things like pinning to superviews.
For instance, I was working on a project where the use of one library constituted 80% of our compile time! The library allows you to declare autolayout constraints using operator overloads (i.e. `foo.top == container.top - 20`) and apparently the amount of type inference was just murdering our compile times. Changing libraries took this project from being awful to work on to quite pleasant.