# Differences in Browser

**URL:** <https://phaser.discourse.group/t/differences-in-browser/5988>\
**Category:** Phaser 3\
**Created:** [April 19, 2020, 7:25pm UTC](https://phaser.discourse.group/t/differences-in-browser/5988 "2020-04-19T19:25:38Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![UltimateProGrammer](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/ultimateprogrammer/32/3069_2.png) [@UltimateProGrammer](https://phaser.discourse.group/u/UltimateProGrammer)\
**Post date:** [April 19, 2020, 7:25pm UTC](https://phaser.discourse.group/t/differences-in-browser/5988/1 "2020-04-19T19:25:38Z")

</div>

Hello,  
I am making a game similar to guitar hero. My game works great on safari but not on Chrome or Firefox. On Safari, my game runs super smooth at 60fps (which is required for the game because of how I made it in the beginning.) However, on Chrome and Firefox there are tons of interruptions and jitters. Chrome has less jitters than Firefox but both are unplayable. The game jam I’m in is due tonight and I’m not sure what to do.

I’m only having this problem because of many stupid decisions in the beginning that I made, such as using 1920x1080 resolution, however changing the resolution would take hours and hours to do, so I only want to do it if I have to.

Any help is greatly appreciated. Feel free to ask questions.

---

<div class="post-metadata">

**Author:** ![embeddedt](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/embeddedt/32/3179_2.png) [@embeddedt](https://phaser.discourse.group/u/embeddedt)\
**Post date:** [April 19, 2020, 9:07pm UTC](https://phaser.discourse.group/t/differences-in-browser/5988/2 "2020-04-19T21:07:54Z")

</div>

I’d suggest using Chrome’s profiler; for other games I’ve made it’s been invaluable for finding the slow parts of my code.

---

<div class="post-metadata">

**Author:** ![UltimateProGrammer](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/ultimateprogrammer/32/3069_2.png) [@UltimateProGrammer](https://phaser.discourse.group/u/UltimateProGrammer)\
**Post date:** [April 19, 2020, 9:27pm UTC](https://phaser.discourse.group/t/differences-in-browser/5988/3 "2020-04-19T21:27:03Z")

</div>

Thanks. I will check it out and put my findings here.

---

<div class="post-metadata">

**Author:** ![Phailser](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/phailser/32/3187_2.png) [@Phailser](https://phaser.discourse.group/u/Phailser)\
**Post date:** [April 20, 2020, 8:39pm UTC](https://phaser.discourse.group/t/differences-in-browser/5988/4 "2020-04-20T20:39:42Z")

</div>

How did it go in the end @UltimateProGrammer?

---

<div class="post-metadata">

**Author:** ![UltimateProGrammer](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/ultimateprogrammer/32/3069_2.png) [@UltimateProGrammer](https://phaser.discourse.group/u/UltimateProGrammer)\
**Post date:** [April 20, 2020, 8:50pm UTC](https://phaser.discourse.group/t/differences-in-browser/5988/5 "2020-04-20T20:50:46Z")

</div>

I’m interested too. I still haven’t had time, I’m going to do it within the next hour :).

---

<div class="post-metadata">

**Author:** ![UltimateProGrammer](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/ultimateprogrammer/32/3069_2.png) [@UltimateProGrammer](https://phaser.discourse.group/u/UltimateProGrammer)\
**Post date:** [April 20, 2020, 9:03pm UTC](https://phaser.discourse.group/t/differences-in-browser/5988/6 "2020-04-20T21:03:45Z")

</div>

It’s kind of inconclusive. I see a lot of timer fired events, (10-20ms) which I think could be the source of the issue. I used setTimeout() and setInterval() quite a lot, so I think I will try to do a test later to see if that really is it.

Chrome actually [has poorly timed setTimeout/setInterval](https://developers.google.com/web/tools/chrome-devtools/rendering-tools#problems) as one of the common problems for performance, so maybe Apple decided to optimize it for some reason.

I think this is actually the reason that Phaser has `timer` so I will make an apples to apples example to see if that really is the issue.

---

<div class="post-metadata">

**Author:** ![UltimateProGrammer](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/ultimateprogrammer/32/3069_2.png) [@UltimateProGrammer](https://phaser.discourse.group/u/UltimateProGrammer)\
**Post date:** [April 20, 2020, 9:35pm UTC](https://phaser.discourse.group/t/differences-in-browser/5988/7 "2020-04-20T21:35:39Z")

</div>

@Phailser Okay, I made the example. You can try it [here](https://natelev.in/games/other/Phaser/general/javascript-wait-vs-phaser-wait/index.html). Conclusive results:  
NEVER USE setTimeout()!!!

[https://natelev.in/games/other/Phaser/general/javascript-wait-vs-phaser-wait/index.html](https://natelev.in/games/other/Phaser/general/javascript-wait-vs-phaser-wait/index.html)

---

<div class="post-metadata">

**Author:** ![embeddedt](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/embeddedt/32/3179_2.png) [@embeddedt](https://phaser.discourse.group/u/embeddedt)\
**Post date:** [April 20, 2020, 9:47pm UTC](https://phaser.discourse.group/t/differences-in-browser/5988/8 "2020-04-20T21:47:16Z")

</div>

I gave it a try on Chrome for Android. `setTimeout` had a bit of jitter but not that much.

---

<div class="post-metadata">

**Author:** ![embeddedt](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/embeddedt/32/3179_2.png) [@embeddedt](https://phaser.discourse.group/u/embeddedt)\
**Post date:** [April 20, 2020, 9:55pm UTC](https://phaser.discourse.group/t/differences-in-browser/5988/9 "2020-04-20T21:55:46Z")

</div>

Desktop Chrome seems to behave the same as mobile Chrome. Firefox on desktop is the worst with very frequent jittering.

---

<div class="post-metadata">

**Author:** ![UltimateProGrammer](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/ultimateprogrammer/32/3069_2.png) [@UltimateProGrammer](https://phaser.discourse.group/u/UltimateProGrammer)\
**Post date:** [April 20, 2020, 9:58pm UTC](https://phaser.discourse.group/t/differences-in-browser/5988/10 "2020-04-20T21:58:40Z")

</div>

Safari has quite a bit of jitter. I don’t know why it didn’t affect it when I was developing my game though.
