[webkit-dev] Iterating SunSpider

Geoffrey Garen ggaren at apple.com
Tue Jul 7 15:58:55 PDT 2009

> Are you saying that you did see Regex as being such a high  
> percentage of javascript code?  If so, we're using very different  
> mixes of content for our tests.

I'm saying that I don't buy your claim that regular expression  
performance should only count as 1% of a JavaScript benchmark.

I don't buy your premise -- that regular expressions are only 1% of  
JavaScript execution time on the web -- because I think your sample  
size is small, and, anecdotally, I've seen significant web  
applications that make heavy use of regular expressions for parsing  
and validation.

I also don't buy your conclusion -- that if regular expressions  
account for 1% of JavaScript time on the Internet overall, they need  
not be optimized.

First, generally, I think it's dubious to say that there's any major  
feature of JavaScript that need not be optimized. Second, it's  
important for all web apps to be fast in WebKit -- not just the ones  
that do what's common overall. Third, we want to enable not only the  
web applications of today, but also the web applications of tomorrow.

To some extent, I think you must agree with me, since v8 copied  
JavaScriptCore in implementing a regular expression JIT, and the v8  
benchmark copied SunSpider in including regular expressions as a test  

I like SunSpider because of its balance. I think SunSpider, unlike  
some other benchmarks, tends to encourage broad thinking about all the  
different parts of the JavaScript language, and design tradeoffs  
between them, while discouraging tunnel vision. You can't just  
implement fast integer math, or fast property access, and call it a  
day on SunSpider. Instead, you need to consider many different  
language features, and do them all well.


More information about the webkit-dev mailing list