I know it's might be silly. But at least, I got this feeling many times.
Sometimes I'm trying to fix some bugs, mostly with Angular's $http
request, callbacks or even with Node promise
.
When things go wrong, I try to put some console.log
to detect the code flow, and from that moment, (mostly) the bugs will disappear! It's not only happened to me.
So I think, somehow, console.log
affect to the performance (make the program run a bit slower), and then, it makes the bugs gone!
I know I'm not the only one think this. Do you think it's possible? Or have you also meet this kind of issue before? please discuss!
Certainly!
This is especially noticeable when logging many items in a loop, or when logging complex objects. Calls to console.log
can be time consuming, and consequently, that delay can resolve some of your race conditions.
JavaScript usually considered as single threaded. that why it is most likely any extra code row will effect the performance.
here is a great answer why it is not sure that it is :(
Is javascript guaranteed to be single-threaded?
Good Luck!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With