[webkit-dev] SharedWorkers alternate design

Maciej Stachowiak mjs at apple.com
Tue May 26 21:43:30 PDT 2009

On May 26, 2009, at 9:05 PM, David Levin wrote:

> I think the principle is simple "classes that can avoid virtuals  
> should."  There are lots of tricky situations, but in general make a  
> good effort to avoid virtual methods (which to me means be prepared  
> to answer why you need a virtual method in a given place).
> By avoid them, there isn't a question of whether the virtuals are  
> affecting performance (in any way -- making inlining impossible,  
> adding to program size, messing with branch prediction, etc.)
> Sometimes great perf is due to one cool algorithm, but a lot of  
> times it is also due to a thousand little things.

Indeed, and we try to do the thousands of little things when we can  
find a practical pattern that enables us to do so. PassRefPtr is an  
example of this; there is probably no one call site where avoiding  
refcount thrash matters, but spread throughout the whole code base, it  
adds up to a measurable improvement.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20090526/04795798/attachment.html>

More information about the webkit-dev mailing list