Jump to content

performance limit of webkit


Kether
 Share

Recommended Posts

I modified the phaser example named "arcade physics/gourp vs self", I change the number of object to 10000

then , off course , fps is very low

But only 14% cpu, and 300m memery be used on my system

Is there any performance limit exist in chrome or webkit ? How can I change it?

Link to comment
Share on other sites

If the render mode is set to Phaser.AUTO, then Phaser will be using webGL to render if it's available.  So it's probably the gpu doing the work, which is why your cpu isn't being stressed.  If you change the render mode to Phaser.CANVAS, then you should see the cpu working harder.

Link to comment
Share on other sites

  • 4 weeks later...
On 2017-5-5 at 6:12 PM, Andromedus said:

If the render mode is set to Phaser.AUTO, then Phaser will be using webGL to render if it's available.  So it's probably the gpu doing the work, which is why your cpu isn't being stressed.  If you change the render mode to Phaser.CANVAS, then you should see the cpu working harder.

Sorry for comming back so late

I tried canvas mode, no big difference

I tried gpu-z , it shows gpu is fine to this test, and cpu too, they all didn't busy enough.

I still think webkit or phaser or physics.arcade have a performance limit.

 

Link to comment
Share on other sites

19 minutes ago, Cictani said:

Probably a single core is at 100%. Since phaser doesn't utilize multiple cores that's the limit.

I using i7 6700k.

All core is down then 30%.

Phaser use multi core fine

Link to comment
Share on other sites

30% is pretty good already. Achieving 100% is borderline impossible with most applications. The bottleneck here is probably memory access. I recommend reading this article to understand how it all works:

http://www.brendangregg.com/blog/2017-05-09/cpu-utilization-is-wrong.html

Even though he talks about the opposite situation, the principles still apply.

Link to comment
Share on other sites

8 minutes ago, Kether said:

I using i7 6700k.

All core is down then 30%.

Phaser use multi core fine

I just run a bunnymark and it only managed to utilize 25% of my cpu which is 100% for a single core (my laptop has 4). I highly doubt that any js game framework utilizes multiple cores. So if you have 8 cores that means a single core is at 100% wich 14% total cpu usage, so cpu is your limiting factor.

Link to comment
Share on other sites

17 minutes ago, Cictani said:

I just run a bunnymark and it only managed to utilize 25% of my cpu which is 100% for a single core (my laptop has 4). I highly doubt that any js game framework utilizes multiple cores. So if you have 8 cores that means a single core is at 100% wich 14% total cpu usage, so cpu is your limiting factor.

Right part of the image , all core is low then 30%, the top one is total,  the red square is paused game for a while. And I tried this test in electron and chrome, same result.

You can see the code after image.

593280d8cc604_per(1).thumb.jpg.554df8a8b0dd280db7e415914cee80f9.jpg

 

Just chang from example in phaser, named "arcade physics/group vs self"

var game = new Phaser.Game(1800, 1600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create, update: update });

function preload() {

    game.load.spritesheet('spinner', 'assets/sprites/bluemetal_32x32x4.png', 32, 32);

}

var sprites;

function create() {

    //  Here we create a group, populate it with sprites, give them all a random velocity
    //  and then check the group against itself for collision

    sprites = game.add.physicsGroup(Phaser.Physics.ARCADE);

    for (var i = 0; i < 9290; i++) {
        var s = sprites.create(game.rnd.integerInRange(100, 700), game.rnd.integerInRange(32, 200), 'spinner');
        s.animations.add('spin', [0, 1, 2, 3]);
        s.play('spin', 20, true);
        s.body.velocity.set(game.rnd.integerInRange(-200, 200), game.rnd.integerInRange(-200, 200));
    }

    sprites.setAll('body.collideWorldBounds', true);
    sprites.setAll('body.bounce.x', 1);
    sprites.setAll('body.bounce.y', 1);

}

function update() {

    game.physics.arcade.collide(sprites);

}

 

Link to comment
Share on other sites

29 minutes ago, Antriel said:

30% is pretty good already. Achieving 100% is borderline impossible with most applications. The bottleneck here is probably memory access. I recommend reading this article to understand how it all works:

http://www.brendangregg.com/blog/2017-05-09/cpu-utilization-is-wrong.html

Even though he talks about the opposite situation, the principles still apply.

I think the game has right to use 80% at least, there is a strict limit because webkit designed for web page I infer

Link to comment
Share on other sites

close everything you have open just open the game and then look at the stats while running the game, you'll see that only one core will be at 100% and the others will be quite low because javascript doesn't use multiple cores by default if you want that you have to use webworkers.

Link to comment
Share on other sites

11 minutes ago, Cictani said:

close everything you have open just open the game and then look at the stats while running the game, you'll see that only one core will be at 100% and the others will be quite low because javascript doesn't use multiple cores by default if you want that you have to use webworkers.

No chrome, Only electron, only one window, still same, 18% CPU total

5932a7dea2333_xxx(1).thumb.jpg.c6c3a9b24a262349938602fbd84fba82.jpg

Link to comment
Share on other sites

23 minutes ago, Cictani said:

close everything you have open just open the game and then look at the stats while running the game, you'll see that only one core will be at 100% and the others will be quite low because javascript doesn't use multiple cores by default if you want that you have to use webworkers.

And other game has more FPS after take more CPU, so, my driver and system are normal. It's no reason  for phaser use so less CPU

If phaser used workers, it shoud show more FPS, not less

while I run "Oxygen Not Included"xxx.thumb.jpg.03a05df185daf66f9ae8764436b1e3d0.jpg

while I run "fallout 4"5932a9ce6aeb1_xxx(1).thumb.jpg.726504d165c8b0a7e00208fccd492406.jpg

Link to comment
Share on other sites

  • 1 month later...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...