Swift High Performance by Kostiantyn Koval

Swift High Performance by Kostiantyn Koval

Author:Kostiantyn Koval [Koval, Kostiantyn]
Language: eng
Format: epub
Publisher: Packt Publishing
Published: 2015-11-05T23:00:00+00:00


The empty loop can be skipped as well. As a result, we have saved 24 MB of memory usage and three million method calls.

Dangerous functions

There are some functions and instructions that sometimes don't provide any value for the application but the Swift compiler can't skip them and they could have a very negative impact on performance.

Console print

Printing a statement to the console is usually used for debug purposes. The print and debugPrint instructions aren't removed from the application in the Release mode. Let's explore this code:

for i in 0...1_000_000 { print(i) }



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.