Why does a single integer assignment statement consume all of my CPU? -- Raymond Chen

A fresh here's-the-code-spot-the-performance-problem analysis.

Why does a single integer assignment statement consume all of my CPU?

by Raymond Chen

From the article:

Profiling showed that over 80% of the time spent by Calculate­The­Value was inside the Set­Int32 method call, in particular on the line

  *reinterpret_cast<int32_t *>(m_data) = value;

Why does it take so much time to store an integer to memory, dwarfing the actual computation to calculate that integer?

Spoiler hint: [Chaotic neutral]

Add a Comment

Comments are closed.

Comments (0)

There are currently no comments on this entry.