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.

Frame rate drop from v3.0.10 to v4.6.1

See original GitHub issue

I am building custom 2D particle engines and using pixi.js at this point as the renderer. I noticed some performance differences between versions. When I updated to v4.6.1 the framerate halved in comparison to v3.0.10. I am running 100k sprites on desktop as my sample set and environment.

I created a minimal sandbox which includes multiple versions of pixi and I simply switch the src to the version. This is not too dissimilar to the bunny mark performance testing tool for pixi. Here is the code:

let width = window.innerWidth;
let height = window.innerHeight;

let renderer = new PIXI.autoDetectRenderer(width, height);
renderer.backgroundColor = 0x000000;
document.body.appendChild(renderer.view);

let stage = PIXI.Container && new PIXI.Container() || PIXI.Stage && new PIXI.Stage();
let rabbitTexture = new PIXI.Texture.fromImage('./../assets/rabbit.png');
let particles = [];
let particleCount = 100000;

function setup() {
    for (let i = 0; i < particleCount; i++) {
        let sprite = new PIXI.Sprite(rabbitTexture);
        sprite.x = Math.random() * window.innerWidth;
        sprite.y = Math.random() * window.innerHeight;
        sprite.alpha = Math.random();
        sprite.scale.set(Math.random() * 3);
        sprite.anchor.set(0.5, 0.5);
        sprite.blendMode = 0;
        sprite.angularVelocity = (Math.random() - 0.5) * 0.1;
        sprite.tint = [0xff0000, 0x00ff00, 0x0000ff][Math.random() * 3 | 0];
        particles.push(sprite);
        stage.addChild(sprite);
    }
}

function update() {
    for (let i = 0, len = particles.length; i < len; i++) {
        let particle = particles[i];
        particle.rotation += 0.1;
    }
}

function render() {
    update();
    renderer.render(stage);
    requestAnimationFrame(render);
}

setup();
render();

This is pretty much as simple as it gets. If there is something I am doing wrong here or perhaps a step I am unaware of, please let me know and I can adjust accordingly. As far as I can tell it is simply the change from version to version.

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
ivanpopelyshevcommented, Nov 28, 2017

Because of different balance of CPU/GPU load. I know which parts are slower, and we are fixing them in v5. But in general, if you dont have that many sprites, v4 is faster. Different demos, different balance, different outcome 😃

1reaction
finscncommented, Nov 29, 2017

There is a discuss about the performance of v3 & v4 : https://github.com/pixijs/pixi.js/issues/3557

Read more comments on GitHub >

github_iconTop Results From Across the Web

Frame rate drop from v3.0.10 to v4.6.1 · Issue #4492 · pixijs/pixijs
I noticed some performance differences between versions. When I updated to v4.6.1 the framerate halved in comparison to v3.0.10.
Read more >
Anyone else having major fps drops and overall low fps?
I have an rtx 2070 with latest driver. the game is laggy as hell. even in menu and my gpu usage barely reaches...
Read more >
Fix Fortnite FPS Drops By Changing This Config Setting ...
Fix Fortnite FPS Drops By Changing This Config Setting! (Season 4 )In today's video I explain a simple fix to stop FPS drops...
Read more >
Timecode to Frames Calculator
It describes a frame that will be shown within 8 minutes, 35 seconds and 13 frames from the beginning of the video. What...
Read more >
How to Solve FPS Drops in All Games (2022 Updated)
Method 3: Scan for Malware and Virus; Method 4: Disable Intel Turbo Boost Technology; Method 5: Check for System File Corruption; Method 6: ......
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