Hacker News .hnnew | past | comments | ask | show | jobs | submitlogin

Wouldn't the print statements have the possibility of screwing up the optimized code (changing register allocations, for example)? Or screwing up the timing? (I realize a debugger would definitely screw up the timing)


So I don't actually use prints; I make log entries in a system service with an enormous buffer. It takes negligible time, certainly compared with a debugger breakpoint!

Unless we suppose a compiler bug, reallocating registers around a print (ok, log) is not a problem. It's still an order of magnitude faster than the 'debug' build.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: