ManicQin said:
Let's ignore for a minute design decisions , readability and any other
of those parameters , In the most raw form of c++ (purely efficiency
if you want)
what is better, bloating up a classes or breaking them up to small
classes?
(and again pure efficiency of the compiler)
Neither big or small. Medium sized classes.
The point is that both human programmers, and modern processors are
sized to handle efficiently in short term memory (L1-cache) a medium
number of items. That is, betweeen 5 and 9, 7 on average.
That's the average number of data member a object shall have,
(multiply by 2 to 4 times for the number of methods).
Of course, you may have exceptions, with one or zero data, or with 40
data fields, but you would have to give a very strong reason why not
store the 40 data into a dictionnary, and why not remove the class
with one data member and using directly the data.
Otherwise, for the question of efficiency of the compiler, by the time
your program is termined (and this will be farther in the future the
more you think about performace in these terms), the hardware will
have evolved in such a way and magnitude, that any step you could have
made toward that efficiency would be totally irrelevant (and possibly
counter productive).