Home > database >  Does printing a lot make some Flutter code run slower?
Does printing a lot make some Flutter code run slower?

Time:01-14

I know that printing a lot can make some Python code run slower (I've tested it and referenced this question). However, I'm not sure if printing a lot makes some Flutter code run slower.

I didn't include the code because I don't think code has anything to do with this and I don't have the code to test it.

Feel free to leave a comment if you need more information.

Does printing a lot make some Flutter code run slower? I would appreciate any help. Thank you in advance!

CodePudding user response:

Well, we preferably use print() in debug mode only. By default, print is disabled in release build of your app, if I'm correct. Unless you call print in loop for over thousand times, it wouldn't have much of an impact on average phones

CodePudding user response:

Flutter does not recommends print() in release mode

Juse use as below code

  void prints(var s) {
    if (kDebugMode) {
      print(s);
    }
  }
  • Related