![]() If you have some complex calculations then put it in a func. Some formulas won’t compile, if they have to many operations, even if they are mathematically correct. It might look less efficient, but the swift parser is much faster this way. If you have calculations, which use + / * – then split them into smaller parts. This way i basically notice no limit in strlen with inline vars “\(*)”. Use the template-syntax which seems much more efficient to parse in swift: var str = "This \(unt) is \(someVar)" Instead of: var str = "This" + String(unt) + " is " + String(someVar) Each new “+” brings the parser to a crawl, and it has to reparse the code everytime you add a new char somewhere in your function body. For me this triggers the slowness very quickly. Some small tricks to make the swift-parser quicker by the way you structure your code.ĭon’t use the “+” concatinator in strings. I also experienced 100%+ CPU while typing some “simple” code. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |