Live data from Hacker News

Unusual speed boost: size matters

webkit.org

1–10 of 74 posts

Re: Unusual speed boost: size matters

#2
Without a doubt, WebKit is one of the most interesting parts of Apple. A community of open source developers that accept contributions (I'm assuming) with a developer-focused open blog with tips on writing C++ - a language not even particularly widely used elsewhere in Apple.

Re: Unusual speed boost: size matters

#4
Interesting that this article doesn't mention profile guided optimization. In my experience, PGO is able to eliminate a lot of the performance problems associated with unnecessary inlines and rarely called functions eating up cache space.

The major downsides are that you can only optimize what the profiler can see and running the thing to make a build takes forever.

Re: Unusual speed boost: size matters

#5
the updateCachedWidth example probably gives the wrong idea to a lot of folks.

You would be just as well off making computeWidth const/pure/readonly/whatever

The compiler can even detect if it modifies anything and mark it for you. In fact, better compilers will compute mod/ref information and know that m_cachedWidth is not touched over that call.

However, LLVM's (which is what at least Apple is using) basic stateless alias analysis is not good enough to do this in this kind of case (there are some exceptions where it might be able to, none apply here)

This is actually a great example of how improving pointer and alias analysis in a compiler buys you gains, and not an example of "how you should modify your code", since you generally should not modify your code to work around temporary single-compiler deficiencies without very good reason.

Especially considering how quickly compiler releases are pushed by Apple/et al.

Re: Unusual speed boost: size matters

#6

Without a doubt, WebKit is one of the most interesting parts of Apple. A community of open source developers that accept contributions (I'm assuming) with a developer-focused open blog with tips on writing C++ - a language not even particularly widely used elsewhere in Apple.

I concur. When I was there, they were pretty clear that everything I made belonged to Apple (which was total bullshit according to California law), that nothing we made would ever be open sourced due to patent issues, and that I was to never say anything about the company in public.

I wonder how their team could swing that culture without tripping over legal at every turn.

Re: Unusual speed boost: size matters

#7
post #3

I may have missed it, but were there any stats about the actual performance gains? It often mentioned binary size etc but nothing about the impact it had.

I, too, found it kind of odd. The bulk of the savings they achieved came from dropping support for the Chromium browser (since Chromium no longer relies on WebKit) and C++ 11. This was a really bizarre article because it had a lot of details about how to reduce the size of a C++ binary but not what that actually means to performance.

What did that 6% binary size reduction buy them in startup time? 10ms? 300ms?

What about memory consumption after startup?

Did tests indicate that the memory locality had improved CPU performance in noticeable manner?

Re: Unusual speed boost: size matters

#8
I liked this article, but the last 3 graphs were really poor. By not listing the actual binary size in some denomination of bytes for the last 3 graphs (only using %s), I get less information from the charts. A much worse problem is the date formatting, which squishes all the numbers together so that they look like one big string. The first graph was much better.

Re: Unusual speed boost: size matters

#9

Without a doubt, WebKit is one of the most interesting parts of Apple. A community of open source developers that accept contributions (I'm assuming) with a developer-focused open blog with tips on writing C++ - a language not even particularly widely used elsewhere in Apple.

I concur. When I was there, they were pretty clear that everything I made belonged to Apple (which was total bullshit according to California law), that nothing we made would ever be open sourced due to patent issues, and that I was to never say anything about the company in public. I wonder how their team could swing that culture without tripping over legal at every turn.

Isn't WebKit based on KDE's KHTML?

Re: Unusual speed boost: size matters

#10
looking on example 1, I wonder why don't languages like C++ or D or Go just add a "pure" keyword for functions that don't modify the global environment or their arguments? this will help the optimizers a lot I imagine. and yeah, I get it that there still could be roundabout side-effects, it's not Haskell, but the compiler could just trust the programmer that he knows what he's doing when he sticks the "pure" keyword before a function definition.
Post reply on HN