2 ms·
Funny he didn't mention a command line tool that gives compile time per function ( explained here http://irace.me/swift-profiling http://irace.me/swift-profilin
by bsaul 10y ago
Funny he didn't mention a command line tool that gives compile time per function ( explained here http://irace.me/swift-profiling http://irace.me/swift-profiling ). That proved to be the greatest help in my case to reduce compile times drastically.
He did mention running a tool to add explicit types everywhere, but it's very often a matter of just writing the most generic ones. Maybe not in uber case, but for everybody else you should try it.
- dep_b 10y agoEspecially when having chained calls like .filter .flatMap .reduce etcetera having an explicitly declared types will take a lot of burden off the compiler. Apart from that dictionaries and arrays should be typed. Also some overloads are really hard to process, especially the '+' operators are pretty expensive when used on non-integers and not (previously) strictly typed values. Never do something like "This is a " + birdName + " on it's nest" but use the "This is a \(birdName) on it's nest" method instead. But sadly it also applies to libraries like Cartography that rely on such overloads to create more elegant declarations.