User forums > General (but related to Code::Blocks)

Severe performance issue regarding the stack

<< < (2/2)

Balazs:
Yes, it IS some alignment issue. Because if I change the class definition (simply by adding surplus int member variables) the running time also changes within quite a big scale (from being very fast to very slow), but ONLY in the case, when the class is allocated on the stack, all other cases are not affected.

An even stranger thing is, that Visual Studio 2003 Toolkit, GCC 3.4.5, GCC 4.0.2 ALL produce the same results!

--
Greets,
Balázs

Balazs:
I'm truly ashamed. :(

All this problem was because of uninitialized data! I didn't initialize one of the array of floats, and later, an if() was based on the results. After doing proper initialization, the problem went away.

I'm sorry for this disturbance, I just wanted others reading this topic know, what the real cause of the problem was, so it would not lead them to false assumptions.

So again: the problem has absolutely nothing to do with stacks or heaps, it was all my fault of not initializing data members properly.

--
Greets,
B.

Navigation

[0] Message Index

[*] Previous page

Go to full version