Locked

Performance Issues in Flash 30.

Community Beginner ,
Jun 07, 2018 Jun 07, 2018

Copy link to clipboard

Copied

We are getting reports from users throughout the Scratch (scratch.mit.edu) community of performance issues related to Flash 30. Upon a deeper investigation it seems as if the main event loop is running much more slowly even in simple tests, this may have something to do with hardware (GPU) acceleration, but more investigation is needed. Results of a single benchmark for Chrome on MacOS are included below, but we are seeing the impacts of these across all 200+ million projects shared in the Scratch online community. We have also been able to repro this on Firefox and Safari on MacOS. We will be testing on Windows shortly and will post results here once complete.

Flash Version - 29.0.0.171

Google Chrome (PPAPI)

Macintosh (OSX)

Pasted image at 2018_06_07 09_28 AM.png

Flash Version - 30.0.0.113

Google Chrome (PPAPI)

Macintosh (OSX)

Views

5.9K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct Answer

Community Beginner , Jun 11, 2018 Jun 11, 2018
Because of the changes by Adobe which increase the cost of `getTimer` and related APIs, we have deployed a patch that resolves the issue by reducing calls to `getTimer` and gets our performance back to where it was before the release of Flash 30 in most instances. If you are curious, details of the patch are available here:Flash 30 performance changes by cwillisf · Pull Request #1396 · LLK/scratch-flash · GitHubTimely assistance from Adobe (particularly in narrowing down the source of our proble...

Likes

Translate

Translate
Adobe Employee ,
Jun 07, 2018 Jun 07, 2018

Copy link to clipboard

Copied

Thank you for the heads up.  Our team has reproduced the issue and we're now investigating further.

Chris

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jun 07, 2018 Jun 07, 2018

Copy link to clipboard

Copied

We've made a necessary mitigation for Spectre/Meltdown-style attacks that significantly increases the cost of calls to getTimer() and related APIs (~100us).  This change isn't apparent in most content, but if you're calling getTimer in a tight loop, the impact is pretty pronounced. The best solution is to modify the content to use getTimer() more judiciously.

From our initial investigation into the Scratch codebase, it does appear that getTimer() is being aggressively used.  Can these API calls be reduced?

An alternative would be to set TimerJitterMicroseconds=0 in the system's mms.cfg file, however this is not recommended as it removes the benefit of the additional security mitigation.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 08, 2018 Jun 08, 2018

Copy link to clipboard

Copied

getTimer() now works about thousand times slowlier than in earlier vers. of FP. Don't you think it's a bad practice, to reduce performance with exploit fixes.

We would appreciate Adobe to release a fix for getTimer() calls

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jun 08, 2018 Jun 08, 2018

Copy link to clipboard

Copied

Unfortunately, reality is messy.  We didn't create this particular problem, but as responsible actors in the web ecosystem, ignoring it also isn't an option.  The security of end-users is more important than backwards compatibility, and one of the very few instances where we would choose a drastic change to existing functionality.

This was also the most surgical option available, and effectively, the least terrible of multiple terrible options.  You'll need to modify your code to call getTimer() less frequently.  If you're highly dependent on high-resolution timing, that's unfortunately pretty problematic, but any browser-based solution for high-resolution timing in a post-Spectre world is going to be impacted to some degree.  Research into similar timing attacks against existing CPUs is an active area of investigation by the larger security community, and it's going to be interesting to see what that research bears over the coming months and years.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 09, 2018 Jun 09, 2018

Copy link to clipboard

Copied

You mention getTimer(), but we realize that our processing on enterFrame() has also degraded by 100 times. It is completely unacceptable for real world applications. Overall, this was the worst solution.

From what we can see, this performance degradation was surprise to you. Responsible teams don't work like this. I will not be surprised that Adobe even didn't optimize their code to make things better. I'm almost sure they didn't.

1000 times degradation.... My boss would fire me immediately if I let such crap going to the market!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jun 09, 2018 Jun 09, 2018

Copy link to clipboard

Copied

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 08, 2018 Jun 08, 2018

Copy link to clipboard

Copied

Thanks for the reply. Timer functions are used in the core event loop for the Scratch interpreter as well as in the "timer" blocks that are used by kids for a variety of projects. We are looking at ways to mitigate / work around this change, but it's currently a little unclear how to overcome such a drastic performance change to the common library.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jun 08, 2018 Jun 08, 2018

Copy link to clipboard

Copied

does getTimer() in 30fps loop will also affect the performance? if yes so it's really time to override this function asap

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jun 09, 2018 Jun 09, 2018

Copy link to clipboard

Copied

Chris, is there a list of related APIs besides getTimer() that are affected by the Spectre/Meltdown mitigation?  It would be really helpful for developers to know what exactly has changed (and the speed impacts for each), so we have some reference of what we might need to update and avoid when we're seeing large performance issues in our projects.  I checked the release notes, but it only lists shareable ByteArrays under the Spectre/Meltdown notes, and doesn't mention getTimer() or anything else that might be impacted.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 09, 2018 Jun 09, 2018

Copy link to clipboard

Copied

Hello, thanks for the insights. One question, does that imply that a timer jitter implementation causes that overhead? I think timer jitters have been introduced to JavaScript's performance.now() on all modern browsers several months ago as a reaction to Spectre, I cannot imagine that caused similar performance problems there, or a lot of websites would have suffered. Or what about invoking a low-resolution OS timer instead? (just some guesses without knowing implementation internals, so I might be wrong here)

Scratch is probably the largest user community using Flash those days (close to 30 million users). Wouldn't it have been an option to run an internal performance test together with the Scratch team before releasing such a breaking change?

Thank you!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jun 10, 2018 Jun 10, 2018

Copy link to clipboard

Copied

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 10, 2018 Jun 10, 2018

Copy link to clipboard

Copied

Flash 30 affects Ookla app running Flash badly.

On Flash 29, download throughput using Ookla speedtest for my 1gbps connection hits 760mbps, using Flash 30, it's only 258mbps.

Adobe please rectify this asap.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 11, 2018 Jun 11, 2018

Copy link to clipboard

Copied

Because of the changes by Adobe which increase the cost of `getTimer` and related APIs, we have deployed a patch that resolves the issue by reducing calls to `getTimer` and gets our performance back to where it was before the release of Flash 30 in most instances. If you are curious, details of the patch are available here:

Flash 30 performance changes by cwillisf · Pull Request #1396 · LLK/scratch-flash · GitHub

Timely assistance from Adobe (particularly in narrowing down the source of our problem) was most appreciated.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 09, 2018 Jul 09, 2018

Copy link to clipboard

Copied

how set EventJitterMicroseconds in android ,and ios,pls ,thanks

h

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jul 09, 2018 Jul 09, 2018

Copy link to clipboard

Copied

Flash Player isn't supported on mobile devices, as such, there is no way to configure this setting mobile devices.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 09, 2018 Jul 09, 2018

Copy link to clipboard

Copied

hi,but the mobile devices,alos gettimer,slow.

how slove that?

thanks very mush

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jul 10, 2018 Jul 10, 2018

Copy link to clipboard

Copied

As mentioned previously, Flash Player is not supported on any mobile devices, as such, there is no workaround to implement on the mobile device.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 10, 2018 Jul 10, 2018

Copy link to clipboard

Copied

But the GETTIME function on the phone is also a thousand times slower. Is there a way to solve this?

But the GETTIME function on the phone is also a thousand times slower. Is there a way to solve this?But the GETTIME function on the phone is also a thousand times slower. Is there a way to solve this?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Most Valuable Participant ,
Jul 11, 2018 Jul 11, 2018

Copy link to clipboard

Copied

But we said, you cannot run Flash on mobile devices. So what connection does this have with your problem?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jul 11, 2018 Jul 11, 2018

Copy link to clipboard

Copied

Are these timer changes/mitigations also present in Adobe AIR as well as Flash Player?  This may be what he's asking about, if mobile apps developed in Adobe AIR for iOS/Android are also experiencing slowness with getTimer.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 13, 2018 Jul 13, 2018

Copy link to clipboard

Copied

Hi, Is the getTimer  performance fix in v30.0.0.134?  If not, which version will the fix be in or how do I find out?  Thanks.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Most Valuable Participant ,
Jul 13, 2018 Jul 13, 2018

Copy link to clipboard

Copied

This will not be fixed, it’s not a bug. The 1000 fold slowdown is deliberate.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 14, 2018 Jul 14, 2018

Copy link to clipboard

Copied

1000 slow,not bug?!

3

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jul 14, 2018 Jul 14, 2018

Copy link to clipboard

Copied

Spectre / Meltdown Mitigations

Same story for javascript

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines