Thiago Macieira wrote: > Benoît Jacob wrote: > >> is the overhead for virtual methods a speed overhead ? >> > > The overhead of a virtual method is an indirect jump (instead of a direct > one). This used to be a problem because it would throw off all prediction > done in modern CPUs, because they didn't predict indirect branches. I > don't know if that's still true. > > So, if you can, avoid virtuals if speed is an issue. > Last time I tried to measure the speed overhead of a virtual method, that was about 3 years ago on a Pentium 3, and it would take millions of calls for the overhead to be noticeable. Which is quite possible when doing computations in a large matrix. -- Guillaume http://telegraph-road.org >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<