So I always make a method like this:
//for printing
private static void _(String s)
{
if (Prefs.DEBUG)
{
com.codename1.io.Log.p(Prefs.ANSI_GREEN+"####StateMachine "+s);
}
}
then when it comes to release I set Prefs.DEBUG (which is final) to false,
would this mean the method was stripped out during compilation? On both
iOS/Android? Or not ? It's just that during dev I really need A LOT of
print outs to follow my code, but then for release obviously I dont want
any. In the old J2ME days I used to do a find and replace on all calls to
_("hello"); etc before release, but im wondering if that's necessary
anymore?
I assume if its not stripped out during compilation then each call even if
it really does nothing may add up (i do a lot in loops etc) to eventually
slow certain things down (even by X many ms). But from what I understand
modern java compilers would remove it since it really doesnt do anything if
debug is false.
--
You received this message because you are subscribed to the Google Groups
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit
https://groups.google.com/d/msgid/codenameone-discussions/da3337af-e83e-4c7d-bdbf-487375537853%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.