# Threejs is dropping frame when scrolling on mobile

**URL:** <https://discourse.threejs.org/t/threejs-is-dropping-frame-when-scrolling-on-mobile/54444>\
**Category:** Questions\
**Tags:** performance\
**Created:** [July 31, 2023, 8:59am UTC](https://discourse.threejs.org/t/threejs-is-dropping-frame-when-scrolling-on-mobile/54444 "2023-07-31T08:59:49Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tibi](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/tibi/32/61300_2.png) [@Tibi](https://discourse.threejs.org/u/Tibi)\
**Post date:** [July 31, 2023, 8:59am UTC](https://discourse.threejs.org/t/threejs-is-dropping-frame-when-scrolling-on-mobile/54444/1 "2023-07-31T08:59:49Z")

</div>

Hi guys,I am working on a project everything is good except on mobile when I scroll the page the framerate drops drastically, I am not sure why and it only happens on mobile.

[https://webdesign-flash.ro/ht/pap/build/](https://webdesign-flash.ro/ht/pap/build/)

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [July 31, 2023, 10:46am UTC](https://discourse.threejs.org/t/threejs-is-dropping-frame-when-scrolling-on-mobile/54444/2 "2023-07-31T10:46:26Z")

</div>

The app is potentially fragment shader bound. For testing, can you see an improvement in performance if you disable post processing on mobile?

---

<div class="post-metadata">

**Author:** ![Tibi](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/tibi/32/61300_2.png) [@Tibi](https://discourse.threejs.org/u/Tibi)\
**Post date:** [July 31, 2023, 12:55pm UTC](https://discourse.threejs.org/t/threejs-is-dropping-frame-when-scrolling-on-mobile/54444/3 "2023-07-31T12:55:39Z")

</div>

I tried to disable the post-processing but still the same issue, when scrolled and when the player gets in the viewport the scroll gets laggy and frame rate drops, I don’t understand why…

---

<div class="post-metadata">

**Author:** ![Tibi](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/tibi/32/61300_2.png) [@Tibi](https://discourse.threejs.org/u/Tibi)\
**Post date:** [August 16, 2023, 8:46am UTC](https://discourse.threejs.org/t/threejs-is-dropping-frame-when-scrolling-on-mobile/54444/4 "2023-08-16T08:46:31Z")

</div>

I have finished the product [Plasmic Audio Player](https://webdesign-flash.ro/p/pap/)

Thank you for your help.

---

<div class="post-metadata">

**Author:** ![new](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/new/32/25580_2.png) [@new](https://discourse.threejs.org/u/new)\
**Post date:** [October 31, 2023, 3:24am UTC](https://discourse.threejs.org/t/threejs-is-dropping-frame-when-scrolling-on-mobile/54444/5 "2023-10-31T03:24:22Z")

</div>

How did you solve the issue? I have the same problem, but on desktop.

---

<div class="post-metadata">

**Author:** ![Tibi](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/tibi/32/61300_2.png) [@Tibi](https://discourse.threejs.org/u/Tibi)\
**Post date:** [October 31, 2023, 6:35am UTC](https://discourse.threejs.org/t/threejs-is-dropping-frame-when-scrolling-on-mobile/54444/6 "2023-10-31T06:35:08Z")

</div>

I could not find a solution other than disabling the post-processing… I don’t understand why this is happening, it makes no sense to me!

I am not sure about your project but make sure to keep a maximum of 60 FPS in my tests, especially on mobile I had even 170FPS and this drains the battery like crazy, 60FPS is more than enough to have a perfect visual experience.

---

<div class="post-metadata">

**Author:** ![new](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/new/32/25580_2.png) [@new](https://discourse.threejs.org/u/new)\
**Post date:** [October 31, 2023, 3:16pm UTC](https://discourse.threejs.org/t/threejs-is-dropping-frame-when-scrolling-on-mobile/54444/7 "2023-10-31T15:16:54Z")

</div>

Got it, thank you for the tips! I disable post-processing on mobile devices but want to keep it enabled on desktop. Can you suggest how to manage FPS limiting?

---

<div class="post-metadata">

**Author:** ![Tibi](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/tibi/32/61300_2.png) [@Tibi](https://discourse.threejs.org/u/Tibi)\
**Post date:** [October 31, 2023, 3:54pm UTC](https://discourse.threejs.org/t/threejs-is-dropping-frame-when-scrolling-on-mobile/54444/8 "2023-10-31T15:54:36Z")

</div>

Sure this is how I did it in the render function

```javascript
const fpsInterval = 1000 / 70;
const current = Date.now();

this.delta = current - this.current;
  
this.elapsed += this.isPlaying ? this.delta : 0;
  
if(this.delta < fpsInterval) return;

// Ececute your render code here!

```
