Why is print() so expensive?
Why is print() so expensive?
Printing to the console, why so expensive? Curious.
Re: Why is print() so expensive?
Because, when you disable IO buffering, it has to push every single character through all the OS' rusty pipes.Bindie wrote:Printing to the console, why so expensive? Curious.
Re: Why is print() so expensive?
Expensive compared to what?
Re: Why is print() so expensive?
S0ll0s: Right, since no memory is available.
Undef: Functions in general, math.random() kinda
Undef: Functions in general, math.random() kinda
Re: Why is print() so expensive?
is that supposed to be sarcasm? Unbuffered IO is generally expensive.Bindie wrote:S0ll0s: Right, since no memory is available.
Re: Why is print() so expensive?
Naw, no no. I didn't understand buffering had to do with memory. No memory = printing every single character then next and so on...
Re: Why is print() so expensive?
Out of curiosity... why is unbuffered io used? Is it so that if love crashes the console will still have all output? Or is it something else?
My Tox ID: 0F1FB9170B94694A90FBCF6C4DDBDB9F58A9E4CDD0B4267E50BF9CDD62A0F947E376C5482610
Re: Why is print() so expensive?
Printing is mainly used for debugging purposes, so you usually wouldn't print out hundreds of lines of code per frame.
Therefore it isn't regarded as an efficiency impairment for game development.
Therefore it isn't regarded as an efficiency impairment for game development.
Re: Why is print() so expensive?
Ahh that makes sense.undef wrote:Printing is mainly used for debugging purposes, so you usually wouldn't print out hundreds of lines of code per frame.
Therefore it isn't regarded as an efficiency impairment for game development.
My Tox ID: 0F1FB9170B94694A90FBCF6C4DDBDB9F58A9E4CDD0B4267E50BF9CDD62A0F947E376C5482610
Re: Why is print() so expensive?
Plus not having console debug output during tests running sucks a lot.I~=Spam wrote:Out of curiosity... why is unbuffered io used? Is it so that if love crashes the console will still have all output? Or is it something else?
Who is online
Users browsing this forum: pgimeno and 4 guests