Kether

performance limit of webkit

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?

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
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.

 

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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);

}

 

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Simply said, the code for physics probably isn't optimized well. As I said before, it's not easy to write code that uses full power of the CPU. You can't really compare code running in VM to highly optimized code of fallout 4.

Share this post


Link to post
Share on other sites
On 2017/6/4 at 3:04 AM, samme said:

You should also check what Chrome's Task Manager reports for the active tab.

Not different, 160M GPU memery, 110M memery, 12% CPU, JS takes 80M memery

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.