trace() causing program to lag



  • I am trying to use trace() to debug my program, and I'm having a problem. I have code set up that calls my debugging code on a timer. (Currently it is called every .5 seconds.) When I add trace() to my debugging code, my program lags to the point of unusability.

    I see no inherent reason this should happen, since logging text to a terminal should not take much processing power. Is there something I can do to make trace() not cause this lag? Or do I just have to display diagnostic statements a different way?



  • hi @chartype

    trace can do undesired stuff like stop the code after trace from working correctly at the variable used in trace. in my case, the error was an array that had a different value than that same variable value in trace. that bug I have verified and that bug happens when you have lots of trace in a class. if you are using flash develop then build to neko because its faster than flash on fast computers. therefore, perhaps you should lower the timer value and use fewer trace in your program



  • @galoyo Ah. Well, I don't think I could use trace any less and still get much useful data. I'll make my own function to log diagnostics. Thanks.


Log in to reply
 

Looks like your connection to HaxeFlixel was lost, please wait while we try to reconnect.