79818093

Date: 2025-11-12 18:18:00
Score: 0.5
Natty:
Report link

In the first case there is more flexibility for compiler to deal with the problem.

"count" is declared in the function and can be returned when the job is done. This means the compiler can keep it wherever it wishes, and it will likely keep it in a CPU register.

In the second case you pass a reference to the "count". That means a few of problems which make vectorization hard:

Reasons:
  • Long answer (-1):
  • No code block (0.5):
  • Contains question mark (0.5):
  • Low reputation (0.5):
Posted by: Denys Rtveliashvili