November 1999
Intermediate to advanced
336 pages
6h 29m
English
Consider the effect of inlining a simple access method (a method that provides access to one of an object's attributes):
int x::get_y()
{
return y;
}
The method itself probably requires only three or four cycles. If invoked, even this trivial method can generate as much as 20 cycles of overhead. If inlined the method will consume only the one or two cycles (two less than the original instruction count because there are no call and return instructions any more). Thus, inlining can provide as much as a 10x speed up. It should also be remembered that most of those 20 cycles of saved overhead had instructions associated with them. This means that in addition to saving the 20 cycles of overhead, we also decreased ...
Read now
Unlock full access