question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Huge continous frame drop gets started after mouse pointer is left browser window.

See original GitHub issue

Expected Behavior

No frame drop or little frame drop

Current Behavior

Reproduce video : https://youtu.be/febJBPb2kBs

Please watch above video. when I make event (mouse or tablet pen whatever) to Container which has quite large sprites (5000 ~ 10000), If I left mouse cursor or event pointer, the frame drop get started. It’s very weird, I don’t understand why it happens. I even didn’t endable “interactive” anywhere. More weird thing is if I hover my mouse or pointer to Container, The frame goes to increase again for example, 30 to 40. But If my pointer left the container, frame drop starts again. in Android tablet, It makes huge continous frame drop like the video. (60ps to 20ps for 30 sec) I see the GoodBoy’s “bunnymark” doesn’t have this problem, because It uses particle container. But in vanilla Container, it happens. in M1 Macbook, while there is no frame drop, the cpu usage goes really higher after pointer leaving the container. The pointer should be left completely (out side of Browser windows) Please tell me why this happen. I made very very simple code to reproduce this.

Steps to Reproduce

import { Application, Sprite, Texture, UPDATE_PRIORITY } from 'pixi.js'
import { addStats } from 'pixi-stats'

class SimpleApp extends Application {

    constructor () {

        super ({

            width : 100,
            height : 100,
            backgroundColor : 0x000000

        })

        document.body.appendChild(this.view)

        const SPRITE_COUNT = 5000

        for (let i = 0; i < SPRITE_COUNT; ++i) {

            const s = new Sprite(Texture.WHITE)

            s.x = Math.random() * 100
            s.y = Math.random() * 100
            s.tint = 0xffffff * Math.random()

            this.stage.addChild(s)

        }

        const stats = addStats(document, this)

        this.ticker.add(stats.update, stats, UPDATE_PRIORITY.UTILITY)
        
    }

}

window.onload = (() => new SimpleApp())

Environment

  • pixi.js version: 6.1.1
  • Browser & Version: Android Glaxay Tab Chrome & Apple M1 Chrome
  • OS & Version: Android or MacOs BigSur
  • Running Example: https://youtu.be/febJBPb2kBs

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ivanpopelyshevcommented, Aug 31, 2021

To switch off interaction you have to do container.interactiveChildren=false, otherwise it will go through all children to check whether someone is interactive. there are no caches, no quadtrees, no bounds checking there, pixi interaction is very simple

You guys looked at https://github.com/pixijs/pixijs/blob/dev/packages/interaction/src/TreeSearch.ts , right?

1reaction
owendwyercommented, Aug 31, 2021

If I wanted to investigate this, I’d look to see how the frame rate behaves with different numbers of sprites - see what happens with 0 sprites, 10 sprites, 100, 500, 1000 etc.

And maybe see how things are different when interaction settings are changed. Things like App.renderer.plugins.interaction.autoPreventDefault = false; App.renderer.view.style.touchAction = ‘auto’;

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is my FPS dropping when I move my mouse cursor in ...
Try "un-updating". Go back to an older driver, or try a system restore to a point where it was working.
Read more >
Windows 11 FPS drops when moving mouse / screen in some ...
Hello, I'm Jan and I'm happy to help you today. I'm sorry that you are experiencing this problem. FPS drop can be caused...
Read more >
How to fix the FPS drops when moving mouse error
Open Settings and go to the Gaming section from the left panel, followed by Xbox Game Bar from the right side. ... Here,...
Read more >
Pc suddenly had massive frame drops out of nowhere, I have ...
Pc suddenly had massive frame drops out of nowhere, I have a 3070. I tried ddu and reseating gpu+cables. This is in all...
Read more >
Fix: Low FPS and Stutters While Gaming on Windows 11
It's not uncommon to experience frame drop issues if you're using an outdated or corrupted driver. In this case, you'll need to use...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found