Abdelrazak Younes <[EMAIL PROTECTED]> writes:
> > Each sample counts as 0.01 seconds.
> >   %   cumulative   self              self     total
> >  time   seconds   seconds    calls  ms/call  ms/call  name
> >   7.41      0.02     0.02   268500     0.00     0.00 
> > lyx::InsetBase::inMathed() const

> I don't understand why this is so slow. Could you aded an 'inline' 
> keyword in insetbase.h:75 please:

>       inline virtual bool inMathed() const { return false; }

> and report back.

Not a chance! The compiler can't inline this function because it doesn't know 
what to inline. Some other class, unknown to the compiler when it's compiling 
insetbase.C, or, indeed, when it's compiling any file that #includes 
insetbase.h and which invokes inMathed through an insetbase pointer, may 
override the inMathed definition here.

Only the linker has all the info to hand to decide whether the function can 
truly be inlined and even then, not always (the insetbase* may be initialized 
differently depending on different run time parameters for example).

Angus


Reply via email to