Reddit Bot: u/Translatesalot

Back to Home

Translated Message


Warning: {closure}(): Argument #2 ($key) must be passed by reference, value given in /home/grumpycr/public_html/subdomains/gibberishinator.grumpycrouton.com/view.php on line 86

Before

It's a loop with a low, constant number of iterations, so it'd most likely get unrolled or otherwise optimized by the compiler. There's also the fact that I/O is orders of magnitude slower than pretty much anything else you can do, so whether the characters get buffered one at a time and then flushed with the newline or buffered together should be negligible compared to the cost of actually writing things out. Of course, if you're dealing with unbuffered I/O for some reason, the loop variant will be much slower, as it would have to make 20 syscalls, compared to just 5 for the linewise version. However, due to all the cost involved with starting and ending a process, the difference will most likely be immeasurable unless you put another loop around this and let it run a couple thousand or ten thousand times.

After

This is a small number of repetitive rotations, so it can rot or be made beautiful by the compiler. There is also the fact that the value of I / O is greater than you can be, so how to store letters one by one and then remove or keep them together in new ways is not worth the price. collection. Well, if for some reason you are dealing with a seamless I / O system, the difference in the cycle will be slower because you need 20 scalps, only 5 lines. However, given all the costs of starting and ending a program, the difference seems unlikely if you don’t put another cycle in it and allow it to run a few thousand or tens of thousands of times.