I just wanted to confirm if using NSLog statements to print the log on the console slow down the application? Also, will it behave in same fashion if instead of logging on console I log them in a file.
Yes, printing many log lines to the console in the inner loops of your code, especially across a USB debugger connection, will slow down the execution somewhat. (The USB I/O may be blocking from the app's standpoint).
As to whether logging to a file is faster, iOS takes NSLog
statements and also filters them into the device's overall console log as well, so they're already heading to disk, but that is probably buffered more intelligently, because that happens on production systems.
Whether you should be logging to a file, it depends on your goals. If you're doing timings on device, just take out the logging while you're timing. If you need the log data while timing, consider buffering a bunch of log strings in memory during the operation and then flushing them somewhere afterwards.