robb / Cartography

A declarative Auto Layout DSL for Swift :iphone::triangular_ruler:
Other
7.35k stars 524 forks source link

speed of == operator overload #347

Open andrewarrow opened 2 years ago

andrewarrow commented 2 years ago

Hello, new to Cartography but I work at a company with a large iOS codebase and they have forked it and replaced == with ~==. Why? Because they found the speed increase in xcode a huge win. i.e. because xcode is doing extra stuff with the normal == (trying to apply normal rules to left and right side of the operator) it slows down a lot once you have > N lines of code.

I suspect many users of Cartography would never notice this speed issue unless their codebase is very large. But wondering if anyone else has seen this and if there is any plan move away from the == ?

Thanks!

anomaddev commented 1 year ago

I just forked the current version and added the relevant code to change the '==' to '~=='. See #348