Tag Archives: Safari

Google Chrome is the winner, Javascript speed-wise

Did some benchmark testing on the Javascript engines of several Mac OS X web browsers by using SunSpider and Google’s V8 benchmark suite. Although Google Chrome is still a development release on OS X, it’s already the winner in this test. Safari 4 comes second, it shows similar results in the SunSpider test but loses more in the V8 test. Sadly Firefox 3.5 loses to both of them by quite a significant margin, despite the fact that Firefox 3.5 introduces the new TraceMonkey JavaScript engine. Opera 10.00 beta 2 is just not a viable competitor to all of the others, I hope this is just because of the beta thing.

Here are some charts that show the results:

sunspider javascript benchmark of firefox, safari, opera and chrome

OS X web browser Javascript speed comparison among firefox, safari, opera and google chrome

V8 benchmark total score of Firefox, Safari, Opera and Google Chrome

Is switching proxies on Mac OS 10.5 scriptable?

I often need to change the network proxies settings frequently due to the need to bypass the GFW when accessing websites that are considered “bad”, and have to set the settings back to not using any proxies when accessing “good” websites.

Doing so in Firefox is easy thanks to the little yet handy plugin called SwitchProxy, but for Safari or other applications which use the global system settings of Mac OS, one has to go through many steps in System Preferences to set them, and then go through the exact steps again to unset them. Too repetitive. I wish there is a way to set and unset proxies easily, but I cannot find one. I bit the bullet and use AppleScript (yuck) to do that, here’s the complete script (beware, this is my first AppleScript program):

I hate to use AppleScript as it simply plays back what a human does, and so the speed is slow, which takes about 5 seconds to finish. I tried to do that by shell script but I couldn’t find the right way to do so, having looked at the defaults command but seems it is not capable at what I want. Anybody knows?