Discuss Scratch

skeletonxf
Scratcher
33 posts

Chrome-Lag

I'd been experiencing horrible amounts of lag in projects with Chrome, to the point where it causes scratch projects to run at about 1/3 to 1/5 of their speed compared to Firefox. While at first I hadn't tested Firefox, after seeing a tip to use Firefox instead I can now say that Chrome is definitely causing lag. When using Firefox to view my projects I also noted that it messes up the location of messages-mystuff-account and a few other things. Please do something about this, Firefox takes 3 times as long to load web-pages for me on my connection and it's annoying having to switch browsers all the time.

Windows XP. 1024*768 resolution.
Lightnin
Scratcher
1000+ posts

Chrome-Lag

Anyone else confirm this? Can you tell us your exact chrome version?

We're testing over here with Macs and Linux and we see no noticeable performance difference when playing a project on Chrome vs. FF. Here's a good example project to test with:

http://beta.scratch.mit.edu/projects/10118230/


DadOfMrLog
Scratcher
1000+ posts

Chrome-Lag

@skeletonxf:
For FF getting things in the wrong location, I see something like that too on a pretty old version (3.6.28), but not more recent versions (e,g, 13.??), so it'd be worth updating if you can (I can't on my OSX10.4 box). Also the same problem on an old Camino browser I have (but don't normally use), which basically uses the same rendering engine as FF, so no surprise I guess.

Here's a screenshot, FYI (note the shifted-down bits top right):
http://i.imgur.com/3nPbBnA.png

Is that what you're seeing? Looks like a FF bug in CSS handling to me…
Safari is fine (4.1.3 is what I have here right now on old OSX 10.4 box).

Concerning the Chrome lag, what version of Flash are you using? If less than 11.x can you update?
Curious if IE has the same problem on Windows?


@Lightnin:
The project you made just shows timings for various things, so I doubt you'll really see much difference, since it looks to me like Chrome is somehow kind of ‘buffering’ the screen updates. This means the project only *looks* like it gets stopped for a second or two, then all blasted to screen at once. I think it doesn't actually cause the running of the project to lag (in fact, my timings suggest Chrome is slightly faster than the other browsers I have - maybe that's *because* of this ‘buffering’ in some way?)

if you really want a project that'll stress out pretty much any machine, try this up-to-100000 stars fly-through:
http://beta.scratch.mit.edu/projects/10096895/

It should be reasonably clear to see if the flight through the starfield becomes ‘choppy’ at higher star count (by that I don't just mean low FPS, but that the frames are appearing at an inconsistent rate, with pauses of a second or so, then maybe jumping suddenly, then looking OK for a few seconds before doing it again).

Worth trying it on different browsers and if you can get hold of older Flash to check that, too.
Lightnin
Scratcher
1000+ posts

Chrome-Lag

Thanks for all your thoughtful analysis, DadOfMrLog! These issues are very hard to nail down, especially since performance will always be degraded at some point, and is dependent on a lot of variables - like machine, OS, etc.

I've put this on JohnM's radar, and we'll start looking more deeply after the release. Meanwhile, if you find any more interesting / useful data, please add it on this thread!
DadOfMrLog
Scratcher
1000+ posts

Chrome-Lag

OK, thanks.

Here's a little something to try out in various browsers, etc:

http://beta.scratch.mit.edu/projects/10125047/
DadOfMrLog
Scratcher
1000+ posts

Chrome-Lag

@Lightnin

Yes, performance will degrade at some point, but there's something pathologically wrong with the way it behaves in certain cases (most noticeable with Chrome), particularly dealing with keyboard events (but also some mouse).

It can mean even a high-end machine crawls to halt and freezes up the browser for several seconds, while a much less powerful one just plods along steadily at the expected slow fps.

See the reports by griffpatch on the lag test project I linked above, for example…

DadOfMrLog
Scratcher
1000+ posts

Chrome-Lag

Several more reports in the lag test project now, so worth taking a look through…

I should point out that the way the project works the power of the machine shouldn't make a huge difference - all it's doing is adding to a list inside a non-refresh block for 1/8th second between each frame update. So that should just mean that a low-power machine just doesn't create as many items as a hi-power machine. The remaining scripting is not doing that much (just moving a single sprite around the screen).

But the behaviour can be significantly different depending on various events, such as key-presses, key-repeats, mouse movement, etc.
Something's really not quite right in such cases…
Failord
Scratcher
1000+ posts

Chrome-Lag

I'm getting lag on MY project in- get this- SAFARI in my Mac. It's fairly new and quite fast. The link to the project is in my signature.
DadOfMrLog
Scratcher
1000+ posts

Chrome-Lag

@Failord

Hmmm, you might want to start off your “speed” variable with something other than infinity…

Can you take a look at the lag test project and report the behaviour (under different browsers, if possible):
http://beta.scratch.mit.edu/projects/10125047/

Thanks.
Failord
Scratcher
1000+ posts

Chrome-Lag

DadOfMrLog wrote:

@Failord

Hmmm, you might want to start off your “speed” variable with something other than infinity…

Can you take a look at the lag test project and report the behaviour (under different browsers, if possible):
http://beta.scratch.mit.edu/projects/10125047/

Thanks.

I edited the way it works so it doesn't lauch as fast. Hope that works…
skeletonxf
Scratcher
33 posts

Chrome-Lag

I can confirm that the image link above is more or less what I'm getting when in Firefox. As for how up-to-date I would expect my Fire-Fox to be out of date as I don't use it much and haven't updated it in a long time, my Chrome however should be up to date as I regularly use it and update. I believe my flash to be 100% up-to-date. How do I check my browser version?
As for what causes the lag from the many different types of games I have uploaded I can say that creating lots of clones at once causes a lag spike pretty consistently across both Chrome and FireFox, though it is more noticeable in chrome. Similarly lots of “touching” and “key pressed” blocks seem to lag my chrome badly but FireFox seems okay.

Last edited by skeletonxf (May 11, 2013 08:55:27)

DadOfMrLog
Scratcher
1000+ posts

Chrome-Lag

There's probably an “about” menu item somewhere that'll tell you browser version (dunno where on win apps - I use Mac & Linux).

The kind of things you mention above for ‘lag’ are not really quite what my lag test program is about (that's more to do with keyboard & mouse events causing inexplicable lock-ups from ~half second to several seconds) - but it's interesting that you note it's generally worse in Chrome, since that's also where the other event-related lag problems seem to be most common…
beyondtool
Scratcher
1 post

Chrome-Lag

Chrome is completely usable for me (using latest version on Windows 7). It's taking minutes to load any page. When I did load that game linked above it was quite laggy and some of the platforms were invisible, then started to appear after I walked over them.

The Scratch 2.0 editor is so slow as to be unusable. Very disappointing and I did not realise Scratch 2.0 was not going to have an executable version at launch. I was really looking forward to it but I won't be able to use it with my students unfortunately.

Firefox doesn't seem to load past the home page of Scratch. Waited 10 minutes, refreshed a few times, got nothing. Looks like a server load issue maybe?

Last edited by beyondtool (May 11, 2013 10:33:53)

DadOfMrLog
Scratcher
1000+ posts

Chrome-Lag

@beyondtool

TBH, it sounds more like a client problem than server - what you're describing doesn't sound like the normal experience for most, and certainly not for me on both Mac & Linux using a variety of browsers.

The game you tried does have several comments about the invisible platforms, so that's not so uncommon, but I've not seen it myself (I think it's only been seen with Chrome, though?)

Concerning a downloadable editor, it's not available yet, but I believe is planned to be done by the summer - a search through these forums should probably confirm that…

Can you try a different machine?

Last edited by DadOfMrLog (May 11, 2013 13:49:08)

acedannyk
Scratcher
100+ posts

Chrome-Lag

This lag is a huge problem as Chrome is an extremely popular browser. A game of mine worked perfectly with zero slowdown before Scratch 2.0 but now at more intense stages it becomes unplayable. This completely ruins the experience for people playing my game because they can't progress any further. I've already received comments about this lag, what am I supposed to say to them? There is nothing wrong with the project.

I would very much like to see this lag issue addressed.
mikebmac
Scratcher
4 posts

Chrome-Lag

One issue with chrome that causes Flash to lag is having multiply instances of Flash installed in a computer.
Type this in your browser:
chrome:plugins

Chances are your first plugin you will see is Flash. Check to make sure that you only have one enabled. If you have more than one enabled Chrome hangs quite a bit on some flash applications, make sure you disable all of the instances of flash except the one labelled: libpepflashplayer.so (this is Chrome's built in flash player).

I personally lagged on my work computer before I did this.

Last edited by mikebmac (May 11, 2013 17:48:19)

darkness3560
Scratcher
100+ posts

Chrome-Lag

mikebmac said: Make sure you disable all of the instances of flash except the one labelled: libpepflashplayer.so (this is Chrome's built in flash player).

Personally, I think the built-in Flash player is much laggier. Go to "chrome://plugins“ and scroll down until you see the ”Shockwave Flash“ plugin. Disable the one that uses ”PPAPI“ and enable the one that uses ”NPAPI". That worked for me.

Last edited by darkness3560 (May 12, 2013 00:19:00)

mikebmac
Scratcher
4 posts

Chrome-Lag

darkness3560 wrote:

mikebmac said: Make sure you disable all of the instances of flash except the one labelled: libpepflashplayer.so (this is Chrome's built in flash player).

Personally, I think the built-in Flash player is much laggier. Go to "chrome://plugins“ and scroll down until you see the ”Shockwave Flash“ plugin. Disable the one that uses ”PPAPI“ and enable the one that uses ”NPAPI". That worked for me.

Possibly, I personally find it the other way around.
skeletonxf
Scratcher
33 posts

Chrome-Lag

I tried opening the plugins and while I found a lot of un-necessary plugins that I disabled I did not have multiple versions of flash. I'll admit having a very slow flash player has made me code my games much more efficiently. I can also agree that the lag from key presses in most cases tends to be freezing rather than bad performance, but I have noticed lower fps in chrome as well.
skeletonxf
Scratcher
33 posts

Chrome-Lag

Well one thing I've noticed is that the key pressed based lag almost goes away when you play a project in embedded form. http://scratch.mit.edu/projects/10725866/

Powered by DjangoBB