Android -- can System.out.println() significantly decrease performance like it does on a PC
System calls are 开发者_如何学JAVAvery expensive. System.out.println()
can bring an app to its knees if ran inside a loop. Does it affect the console-less android similarly?
Ran a quick test for you using a 10000000 iteration loop.
Empty ~ 200ms System.out.println() ~ 5600ms System.out.println("abcdefghijklmnop") ~ 90000ms
Up to you apply that to your situation whether it is acceptable or not.
Btw it doesn't do nothing, it prints to the device log
精彩评论