PDA

View Full Version : Safari To Get JavaScript Speed Enhancements




MacRumors
Jun 5, 2008, 02:01 AM
http://www.macrumors.com/images/macrumorsthreadlogo.gif (http://www.macrumors.com)

The WebKit project announced this week a new and improved JavaScript interpreter, code-named SquirrelFish (http://webkit.org/blog/189/announcing-squirrelfish/).

SquirrelFish promises 1.6 times faster JavaScript interpreting as compared to Webkit/Safari 3.1. This is accomplished by using "a register-based, direct-threaded, high-level bytecode engine" which aims to eliminate the overhead associated with traditional syntax tree walking interpreters like the one currently used in Safari 3.1.x.


http://images.macrumors.com/article/2008/06/05/012912-squirrelfish-webkit-graph_400.png

SunSpider runs per minute. Image courtesy webkit.org

The introduction of the open-source effort means the improvements will almost certainly be propagated into Apple's Safari web browser, however the timing is unknown.

Of note, Safari 3.1 saw dramatic speed improvements (http://www.macrumors.com/2008/02/09/safari-3-1-to-bring-performance-boosts-snappier/) over 3.0.x, indicating Apple has been and continues to be actively engaged in Safari/WebKit JavaScript performance.

Article Link (http://www.macrumors.com/2008/06/05/safari-to-get-javascript-speed-enhancements/)



epanov
Jun 5, 2008, 02:01 AM
I am not really technical and stuff. What exactly will this do for the user?

arn
Jun 5, 2008, 02:05 AM
I am not really technical and stuff. What exactly will this do for the user?

um... makes Javascript go faster. which is used on many websites.

arn

longofest
Jun 5, 2008, 02:06 AM
um... makes Javascript go faster. which is used on many websites.

arn

you resisted it with all your might, didn't you....


the real answer, of course, is: it will make Safari snappier™

solipsism
Jun 5, 2008, 02:16 AM
In March WebKit made page load faster by reducing latency by allowing side parsers to run when the main parser gets held up. WebKit is also fastr than other browsers with heavy JS becasue they already parse JS much more efficiently. This rocks!• http://webkit.org/blog/166/optimizing-page-loading-in-web-browser/

I am not really technical and stuff. What exactly will this do for the user?

If a web browser can parse code more efficiently then your page will render faster.

peedub
Jun 5, 2008, 02:24 AM
this is something to look forward to i guess... but where the heck do they come up with these names? SquirrelFish? haha what were they thinking?

Beric
Jun 5, 2008, 02:25 AM
you resisted it with all your might, didn't you....


the real answer, of course, is: it will make Safari snappier™

Please oh please.

MY only question was how low of a post-number in this topic would a "snappier Safari" get mentioned. Apparently on post #4. :rolleyes:

Matthew Yohe
Jun 5, 2008, 02:26 AM
this is all you need to know:
http://farm4.static.flickr.com/3194/2547403160_af28741671.jpg

DMann
Jun 5, 2008, 02:26 AM
this is something to look forward to i guess... but where the heck do they come up with these names? SquirrelFish? haha what were they thinking?
speed-Speed-SPEED.

By comparison, Longhorn seems less effective.

solipsism
Jun 5, 2008, 02:27 AM
but where the heck do they come up with these names? SquirrelFish? haha what were they thinking?
• http://en.wikipedia.org/wiki/Squirrelfish

Mac OS X Ocelot
Jun 5, 2008, 02:38 AM
I have JavaScript turned off in Safari. Webpages take much, much less time loading now. I'm learning to live without it entirely.

RTee
Jun 5, 2008, 02:52 AM
good stuff!

Squid7085
Jun 5, 2008, 03:01 AM
Oh, how about Flash speed and stability first. That would be nice. The web seems to be seeing flash as the future, yet when my PowerBook visits a site with even a flash ad on it, I feel as if my machine is about to take off and leave my lap.

arn
Jun 5, 2008, 03:03 AM
Oh, how about Flash speed and stability first. That would be nice. The web seems to be seeing flash as the future, yet when my PowerBook visits a site with even a flash ad on it, I feel as if my machine is about to take off and leave my lap.

That's up to Adobe, not Apple/Webkit.

arn

Darkroom
Jun 5, 2008, 03:17 AM
i don't exactly know how "slow" javascript has ever been... seems to have always been as instant as a site loading... what could really use some improvement is flash... don't get me wrong, the FPS of flash on safari are great, and much better than firefox or camino, but flash is often slow to initiate, if it doesn't cause the browser to crash.

leehericks
Jun 5, 2008, 03:24 AM
Well, as always debated, some believe that Web 2.0 using Javascript is a hell of a lot better than using Flash. Which means when a web app like Meebo loads up in your browser and uses Javascript non-stop, you want it to execute quickly.

Applepi
Jun 5, 2008, 03:29 AM
Safari can always be snappier..

Squid7085
Jun 5, 2008, 04:03 AM
That's up to Adobe, not Apple/Webkit.

arn

I know, just a general statement. :D As stated by somebody else, I just have Javascript disabled. Matter of fact, it appears to be used so little that I completely forgot I disabled it.

psychofreak
Jun 5, 2008, 04:06 AM
I have a feeling that this may come very soon, the latest Webkit nightlies have been really stable, even more so than Safari 3.1

sam-i-am
Jun 5, 2008, 04:20 AM
I did some speed tests using the latest webkit (whcih includes the new squirrelfish stuff) and a bunch of other browsers. I posted the results at my blog for anyone who is interested:

http://gthing.net/new-javascript-engine-in-webkit-nerd-stuff/

The bottom line is that it is almost twice as fast as Safari, and not even in the same ballpark as firefox 2, 3 beta, internet explorer, etc. This thing is smoking!

Fotek2001
Jun 5, 2008, 05:02 AM
I know, just a general statement. :D As stated by somebody else, I just have Javascript disabled. Matter of fact, it appears to be used so little that I completely forgot I disabled it.

Find me a major website that doesn't use JavaScript somewhere. I find it hard to believe you can have any kind of meaningful browsing experience these days without Javascript.

Squid7085
Jun 5, 2008, 05:05 AM
Find me a major website that doesn't use JavaScript somewhere. I find it hard to believe you can have any kind of meaningful browsing experience these days without Javascript.

Let me rephrase that, there is nothing that I know I am missing. :D Can't miss it if you don't know it is there. Now that I checked, it actually isn't disabled anymore, I guess I never disabled it after I reinstalled a few weeks ago. Weird.

Ice Berg
Jun 5, 2008, 05:44 AM
The webkit nightly build tonight seems a heck of alot faster but it still gets real slow loading pages after about 10 minutes of surfing. Is there still a memory leak in Safari or Webkit nightly builds??:confused::confused:

winterspan
Jun 5, 2008, 05:51 AM
I am not really technical and stuff. What exactly will this do for the user?

Most visibly, it will speed up the loading and processing of interactive web sites and web applications.


I have JavaScript turned off in Safari. Webpages take much, much less time loading now. I'm learning to live without it entirely.

I know, just a general statement. :D As stated by somebody else, I just have Javascript disabled. Matter of fact, it appears to be used so little that I completely forgot I disabled it.

You can't be serious. So you guys apparently don't ever use javascript-based/AJAX web applications. It seems as if nearly every popular web application on the internet uses AJAX/Javascript in some form. Google/MSN Maps? Gmail? Google Reader? Google Docs? Meebo?

elppa
Jun 5, 2008, 05:54 AM
I have JavaScript turned off in Safari. Webpages take much, much less time loading now. I'm learning to live without it entirely.

This is not the best idea, although they really shouldn't some sites rely on them. If you are writing a .NET web application and use the built in components then javascript is hard to avoid.

Oh, how about Flash speed and stability first. That would be nice. The web seems to be seeing flash as the future, yet when my PowerBook visits a site with even a flash ad on it, I feel as if my machine is about to take off and leave my lap.

Apple is trying to eliminate proprietary standards from the web i.e. flash, silverlight which means the web stays open, interoperable and not controlled by any one vendor.

It's quite a noble effort and some of the stuff you can do with CSS in webkit (which will get rolled into standards) can rival some flash stuff (annimation, masks, vector graphics etc.). Apple's website is flash free, yet still has interactivity.

That said I doubt they appreciate the flash experience is bad on the Mac, but this as Arn correctly points out, this is Adobe's problem to solve and they probably won't get much help from Cupertino.

I did some speed tests using the latest webkit (whcih includes the new squirrelfish stuff) and a bunch of other browsers. I posted the results at my blog for anyone who is interested:

http://gthing.net/new-javascript-engine-in-webkit-nerd-stuff/

The bottom line is that it is almost twice as fast as Safari, and not even in the same ballpark as firefox 2, 3 beta, internet explorer, etc. This thing is smoking!

Smokin'. Thanks for the stats, that's pretty interesting. Bookmarked.

Tsurisuto
Jun 5, 2008, 06:07 AM
Oh, how about Flash speed and stability first. That would be nice. The web seems to be seeing flash as the future, yet when my PowerBook visits a site with even a flash ad on it, I feel as if my machine is about to take off and leave my lap.

I have been using the Flash Player 10 beta since it's release, and I have to say that it is a GREAT improvement over the current Flash Player.

abrooks
Jun 5, 2008, 06:16 AM
I have been using the Flash Player 10 beta since it's release, and I have to say that it is a GREAT improvement over the current Flash Player.

Except the majority of websites now claim that I don't have Flash installed at all and it still takes up 60-70% CPU to play a YouTube video.

dernhelm
Jun 5, 2008, 06:25 AM
SquirrelFish promises 1.6 times faster JavaScript interpreting as compared to Webkit/Safari 3.1. This is accomplished by using "a register-based, direct-threaded, high-level bytecode engine" which aims to eliminate the overhead associated with traditional syntax tree walking interpreters like the one currently used in Safari 3.1.x.



register based, direct threaded... Sounds like Intel only. Probably hit GA around the same time as 10.6?

Compile 'em all
Jun 5, 2008, 07:01 AM
Please merge with http://forums.macrumors.com/showthread.php?t=493314 me reported it first :cool:

gzfelix
Jun 5, 2008, 07:09 AM
Come on, please solve Safari's memory leak problems first..

kornyboy
Jun 5, 2008, 07:20 AM
Wirelessly posted (iPhone: Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/4A102 Safari/419.3)

The faster they can make Safari the better. I may even switch from Firefox if things continue.

Shadow
Jun 5, 2008, 07:21 AM
Except the majority of websites now claim that I don't have Flash installed at all and it still takes up 60-70% CPU to play a YouTube video.

Absolutely. That was why I downgraded to 9 again.

Ontopic: I tried the latest nightly and I only get 99 in the Acid3 test. Can anyone verify that or is it just me?

psychofreak
Jun 5, 2008, 07:29 AM
Absolutely. That was why I downgraded to 9 again.

Ontopic: I tried the latest nightly and I only get 99 in the Acid3 test. Can anyone verify that or is it just me?

I'm getting 100, it may be a plug-in you have. Try resetting Safari from the Safari menu item

angelwatt
Jun 5, 2008, 08:02 AM
Most visibly, it will speed up the loading and processing of interactive web sites and web applications.

You can't be serious. So you guys apparently don't ever use javascript-based/AJAX web applications. It seems as if nearly every popular web application on the internet uses AJAX/Javascript in some form. Google/MSN Maps? Gmail? Google Reader? Google Docs? Meebo?

I'm a web developer, and if a site is designed correctly it won't require JavaScript to be enabled to be used. You may not have the same experience, but the functionality should still be there (some exceptions exist of course). Many sites have to provide non-JavaScript capabilities to meet accessibility requirements such as Section 508. I use Firefox with the NoScript extension so I can disable JavaScript except for certain sites, and I notice a dramatic difference in load speeds. So many sites have a craptacular amount of JavaScript they try to load, which does nothing.

More on topic, speeding up JavaScript is nice, but I find the biggest slowdowns come from browser-to-server communications like "real" AJAX. I've never had JavaScript be anything but fast so this news doesn't mean much too me.

salohcin
Jun 5, 2008, 08:10 AM
you resisted it with all your might, didn't you....


the real answer, of course, is: it will make Safari snappier™

And Leon Larrrrger.

Fiveos22
Jun 5, 2008, 08:42 AM
SquirrelFish, eh? I can't wait to go hunting for one of those. I'll get it stuffed and hang it between my Jackalope and FurFish.

shen
Jun 5, 2008, 08:50 AM
in another seven or eight versions javascript will be usable!

chickenninja
Jun 5, 2008, 09:14 AM
"squirrelfish" .... that is the most beautiful name for a piece of software i have ever heard. its like fireworks

BklynKid
Jun 5, 2008, 10:02 AM
I know, just a general statement. :D As stated by somebody else, I just have Javascript disabled. Matter of fact, it appears to be used so little that I completely forgot I disabled it.

What sites do you visit?

Web 2.0 = javascript + spinners.

bytethese
Jun 5, 2008, 10:13 AM
Snappier Safari? You don't say! :)

clevin
Jun 5, 2008, 11:11 AM
Apple is trying to eliminate proprietary standards from the web i.e. flash, silverlight which means the web stays open, interoperable and not controlled by any one vendor.


I don't believe so, first flash and silverlight are not web-standards, silverlight is not even a practical using standard since not many ppl use it after all.

Also, apple can first open its QuickTime, if they really want to fully open the web.

Its naive thinking to portray apple as "holier than others", Apple isn't trying to do anything that doesn't benefit itself.

To talk about open to others, last time I checked, SUN opened JAVA, Adobe started Open Screen Project to gradually open flash. M$ tried and opened up partially the office format.

What did apple open? again?

chameleon
Jun 5, 2008, 11:19 AM
This is very interesting.

I'd be curious to see how this compares to the latest build of Firefox 3, which is supposed to be very fast too.

wrldwzrd89
Jun 5, 2008, 11:22 AM
This is very interesting.

I'd be curious to see how this compares to the latest build of Firefox 3, which is supposed to be very fast too.
Did you look at the link sam-i-am posted? (Repeated here (http://gthing.net/new-javascript-engine-in-webkit-nerd-stuff/) for brevity.) It shows that Firefox 3 RC1 isn't even close to matching SquirrelFish in JavaScript performance.

clevin
Jun 5, 2008, 11:33 AM
Did you look at the link sam-i-am posted? (Repeated here (http://gthing.net/new-javascript-engine-in-webkit-nerd-stuff/) for brevity.) It shows that Firefox 3 RC1 isn't even close to matching SquirrelFish in JavaScript performance.

it is accepted by all teams that sunspider is currently most fair javascript speed test. There is a reason for that since there are many ways you can generate any numbers you want....

The competition should be between SquirrelFish and Tarmarin+SpiderMonkey 2. Which is quite pre-mature since Mozilla is still focusing on getting Firefox 3 out of the door. and SquirrelFish has just been announced.

Firefox 3 will be compared with other shipping browsers, and we can wait for next gen of browsers before making other comparisons.

wrldwzrd89
Jun 5, 2008, 11:36 AM
it is accepted by all teams that sunspider is currently most fair javascript speed test. There is a reason for that since there are many ways you can generate any numbers you want....

The competition should be between SquirrelFish and Tarmarin+SpiderMonkey 2. Which is quite pre-mature since Mozilla is still focusing on getting Firefox 3 out of the door. and SquirrelFish has just been announced.

Firefox 3 will be compared with other shipping browsers, and we can wait for next gen of browsers before making other comparisons.
You make a very valid point. I didn't know Tarmarin+SpiderMonkey 2 existed - it's good to know that the Firefox team is working on getting their JavaScript interpreter to perform better.

That said, I wouldn't be surprised if Apple releases Safari 3.2 sooner rather than later. It probably won't include SquirrelFish, but that's okay - SquirrelFish is a feature good enough to put in Safari 4 :p

ChrisA
Jun 5, 2008, 11:40 AM
i don't exactly know how "slow" javascript has ever been... seems to have always been as instant as a site loading.

Yes it's fast on a multi-ghz 64 bit Intel processor. But now Apple is putting Safari on the iPhone. The little CPU inside the iPhone is not so fast

TCM333
Jun 5, 2008, 11:56 AM
I am not really technical and stuff. What exactly will this do for the user?

it will make Safari snappier!!!

twoodcc
Jun 5, 2008, 12:02 PM
well the more speed, the better

shawnce
Jun 5, 2008, 12:13 PM
register based, direct threaded... Sounds like Intel only. Probably hit GA around the same time as 10.6?

Go download the nightly and you will find it works just fine on PowerPC systems.

shawnce
Jun 5, 2008, 12:20 PM
What did apple open? again? Apple (among others) have successfully pushed for video and audio to become first class elements of HTML (HTML 5) instead of being relegated to browser plugins. They pushed for the video and audio encoding used to be ones that are open standards with low-cost / no-cost encoders. They are doing similar things with CSS animations, etc. with the obvious goal being to have these capabilities codified in an open standard that all vendors can participate in instead of a few.

Anyway Apple during the last decade has made large efforts to covert their "systems" over to use open standards as much as possible getting away from proprietary codecs, etc. In fact Apple is one of the reasons that H.264 and related codecs are so prevalent on the web today despite the best efforts of some vendors.

Why is Apple doing this? ...because it levels the playing field and undermines their main competitors...

plinden
Jun 5, 2008, 12:26 PM
I posted some test results I did in another thread - I should have posted here but didn't spend long enough looking.

http://forums.macrumors.com/showthread.php?p=5533390&posted=1#post5533390

Anyway, to summarize, I found the first version of SquirrelFish is indeed the fastest Javascript parser on OS X and XP.

sebastianlewis
Jun 5, 2008, 12:44 PM
I don't believe so, first flash and silverlight are not web-standards, silverlight is not even a practical using standard since not many ppl use it after all.

Also, apple can first open its QuickTime, if they really want to fully open the web.

Its naive thinking to portray apple as "holier than others", Apple isn't trying to do anything that doesn't benefit itself.

To talk about open to others, last time I checked, SUN opened JAVA, Adobe started Open Screen Project to gradually open flash. M$ tried and opened up partially the office format.

What did apple open? again?

I agree with you that Apple is not holier than thou, however they did open up the Quicktime format as MPEG-4 Part 12 as the base for MPEG-4 Part 14. Also the WebKit team implemented the audio and video tags of HTML5 to try and help push that standard, if it succeeds than stuff like Flash and Quicktime won't be needed to playback audio and video on the web, although Safari still uses Quicktime to make it possible, I think WebKit/GTK+ is using Gstreamer though... hmm.

Sebastian

dal20402
Jun 5, 2008, 05:08 PM
it will make Safari snappier!!!

ROFL... :D:p

elppa
Jun 5, 2008, 07:09 PM
I don't believe so, first flash and silverlight are not web-standards, silverlight is not even a practical using standard since not many ppl use it after all.
Standards can be de-facto standards as well. Since flash is installed on >90% of computers and is used for most web video I think it is a standard. Silverlight is still relevant, because it is Microsoft backed and Microsoft are the world's biggest software company trying to stake their claim on the web.

Also, apple can first open its QuickTime, if they really want to fully open the web.
Quicktime is less of a web standard than flash, Quicktime is the multimedia framework for OS X. Apart from that there is no reason for Apple to open Quicktime when all it is mainly used to play back are standard formats such as AAC and H.264. Any other media playback software can do this should they chose to, so there is no lock in.

Its naive thinking to portray apple as "holier than others", Apple isn't trying to do anything that doesn't benefit itself.
Yes, but I have never portrayed Apple as holier than thou. And no commercial company should be doing anything other than looking after their own interests. It would be inappropriate to do anything else.

To talk about open to others, last time I checked, SUN opened JAVA, Adobe started Open Screen Project to gradually open flash. M$ tried and opened up partially the office format.

What did apple open? again?

Off the top of my head:
Darwin
Webkit
CUPS
LLVM
Quicktime (Darwin) Streaming Server

The MS “partial” open office format is the biggest self-serving joke ever. They had to rig votes to get it through as a standard. The documentation (although long) is wooly, confusing and incomplete. Really poor example.

Not only that, Apple makes use of many other open source technologies and standards. That's what they are there for after all.

It's not as impressive as companies like Sun, but it's not bad either. Many of these projects were open source and picked up by Apple, but have benefited from their cash.

charlieMonroe
Jun 6, 2008, 07:10 AM
We might see the new Safari coming out on Monday: https://trac.webkit.org/browser/branches/WWDC-2008-branch - that's a WebKit branch labeled WWDC-2008 with Squirrelfish merged in.

wrldwzrd89
Jun 6, 2008, 08:23 AM
We might see the new Safari coming out on Monday: https://trac.webkit.org/browser/branches/WWDC-2008-branch - that's a WebKit branch labeled WWDC-2008 with Squirrelfish merged in.
Thanks for the report! Clever eye there... I'm looking forward to this. :D

clevin
Jun 6, 2008, 08:43 AM
Off the top of my head:
Darwin
Webkit
CUPS
LLVM
Quicktime (Darwin) Streaming Server
.

omg, this is unbelievable, how can apple just purchased CUPS couple of months ago and turn around in your words as if they developed it and opened it? it was an full featured system before the transaction.

webkit is not opened by apple neither, in case you forgot, KHTML has been a full featured browser for ages before apple took it. if anything, apple tried to made it as close as it can for a while.

Darwin is a mixture of NEXTSTEP, Apple codes, FreeBSD and other OSS components, to imply that apple own them all is also untrue and misleading.

LLVM? apple has some ppl working at LLVM group means apple owns it and opens it? where is that logic? IBM, Ubuntu, redhat all have ppl working on Unix, Linux, or firefox, I didn't see them claim they opened Linux or firefox. LLVM was, and is an independent OSS group at UIUC.

You want to say apple contribute $$$ and work force in OSS? thats fine with me.

But to say apple aggressively open the stuff that used to be closed. as you implied in original post. Its absurd statement.

elppa
Jun 6, 2008, 09:46 AM
omg, this is unbelievable, how can apple just purchased CUPS couple of months ago and turn around in your words as if they developed it and opened it? it was an full featured system before the transaction.

OMG! Can't you read? I've already covered this.
Many of these projects were open source and picked up by Apple.

So yes, Apple recognises great open source software and make a contribution to it. They have also opened up some of their own stuff, like Quicktime Streaming Server, Bonjour and the Keychain.

I can't really see what point you are trying to make:
Is it that recognising and improving great open source software is less important than opening up current software?

Why is this relevant? Why do you draw the distinction? What difference does it make? I'm really confused by your arguments.

You need to understand the bigger picture: Having some proprietary hooks is sometimes important for making money. Apple has many stake holders not just the FOSS community (shareholders for one). They need to balance everyone's needs and sometimes that means keeping things closed. Commercial software can still be very good. Apple balances both quite skilfully.

Trip.Tucker
Jun 11, 2008, 04:17 PM
I have JavaScript turned off in Safari. Webpages take much, much less time loading now. I'm learning to live without it entirely.

I don't know how.... so many sites are employing ajax and some javascript to facilitate the content.

Trip.Tucker
Jun 11, 2008, 04:18 PM
omg, this is unbelievable, how can apple just purchased CUPS couple of months ago and turn around in your words as if they developed it and opened it? it was an full featured system before the transaction.

webkit is not opened by apple neither, in case you forgot, KHTML has been a full featured browser for ages before apple took it. if anything, apple tried to made it as close as it can for a while.

Darwin is a mixture of NEXTSTEP, Apple codes, FreeBSD and other OSS components, to imply that apple own them all is also untrue and misleading.

LLVM? apple has some ppl working at LLVM group means apple owns it and opens it? where is that logic? IBM, Ubuntu, redhat all have ppl working on Unix, Linux, or firefox, I didn't see them claim they opened Linux or firefox. LLVM was, and is an independent OSS group at UIUC.

You want to say apple contribute $$$ and work force in OSS? thats fine with me.

But to say apple aggressively open the stuff that used to be closed. as you implied in original post. Its absurd statement.

You, sir, make no sense at all.

Trip.Tucker
Jun 11, 2008, 04:21 PM
This is not the best idea, although they really shouldn't some sites rely on them. If you are writing a .NET web application and use the built in components then javascript is hard to avoid.



Apple is trying to eliminate proprietary standards from the web i.e. flash, silverlight which means the web stays open, interoperable and not controlled by any one vendor.

It's quite a noble effort and some of the stuff you can do with CSS in webkit (which will get rolled into standards) can rival some flash stuff (annimation, masks, vector graphics etc.). Apple's website is flash free, yet still has interactivity.

That said I doubt they appreciate the flash experience is bad on the Mac, but this as Arn correctly points out, this is Adobe's problem to solve and they probably won't get much help from Cupertino.



Smokin'. Thanks for the stats, that's pretty interesting. Bookmarked.

...don't forget CSS 3 which will bring in some really cool new functionality.