Do global variables mean faster code?

后端 未结 14 1977
情深已故
情深已故 2020-12-24 00:58

I read recently, in an article on game programming written in 1996, that using global variables is faster than passing parameters.

Was this ever true, and if so, is

14条回答
  •  星月不相逢
    2020-12-24 01:48

    It was faster when we had <100mhz processors. Now that that processors are 100x faster this 'problem' is 100x less significant. It wasnt a big deal then, it was a big deal when you did it in assembly and had no (good) optimizer.

    Says the guy who programmed on a 3mhz processor. Yes you read that right and 64k was NOT enough.

提交回复
热议问题