Virtual methods

bearophile bearophileHUGS at lycos.com
Thu Feb 4 07:15:46 PST 2010


dsimcha:
> Is that still a relevant optimization?  It probably made sense circa 1995 when
> computers had much less memory, but now I would think that binaries are so much
> smaller than a typical computer's memory that they almost never get paged out.

It's useful still, but just a little, there are far more important optimizations (LTO, other forms of profiling that allow for partial unrolling even you don't know at compile time the number of cycles, inlining of ex-virtual functions, and so on). Grouping often used functions is useful because they can be kept better in L2 cache, and sometimes they can even be kept in L1 :-)

Bye,
bearophile



More information about the Digitalmars-d mailing list