Kether Posted May 4, 2017 Share Posted May 4, 2017 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 More sharing options...
Andromedus Posted May 5, 2017 Share Posted May 5, 2017 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 More sharing options...
Kether Posted June 3, 2017 Author Share Posted June 3, 2017 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 More sharing options...
Cictani Posted June 3, 2017 Share Posted June 3, 2017 Probably a single core is at 100%. Since phaser doesn't utilize multiple cores that's the limit. Link to comment Share on other sites More sharing options...
Kether Posted June 3, 2017 Author Share Posted June 3, 2017 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 More sharing options...
Antriel Posted June 3, 2017 Share Posted June 3, 2017 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. samme 1 Link to comment Share on other sites More sharing options...
Cictani Posted June 3, 2017 Share Posted June 3, 2017 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 More sharing options...
Kether Posted June 3, 2017 Author Share Posted June 3, 2017 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. 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 More sharing options...
Kether Posted June 3, 2017 Author Share Posted June 3, 2017 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 More sharing options...
Cictani Posted June 3, 2017 Share Posted June 3, 2017 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 More sharing options...
Kether Posted June 3, 2017 Author Share Posted June 3, 2017 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 Link to comment Share on other sites More sharing options...
Kether Posted June 3, 2017 Author Share Posted June 3, 2017 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" while I run "fallout 4" Link to comment Share on other sites More sharing options...
Cictani Posted June 3, 2017 Share Posted June 3, 2017 Can you check out pixi.js bunny mark? https://pixijs.github.io/bunny-mark/. By default it'll render 100000 textures, you can set it even higher. Link to comment Share on other sites More sharing options...
Antriel Posted June 3, 2017 Share Posted June 3, 2017 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. Link to comment Share on other sites More sharing options...
samme Posted June 3, 2017 Share Posted June 3, 2017 You should also check what Chrome's Task Manager reports for the active tab. Link to comment Share on other sites More sharing options...
Kether Posted June 4, 2017 Author Share Posted June 4, 2017 11 hours ago, Cictani said: Can you check out pixi.js bunny mark? https://pixijs.github.io/bunny-mark/. By default it'll render 100000 textures, you can set it even higher. 300000, v4.5.2 7 FPS, cpu and gpu still idle Link to comment Share on other sites More sharing options...
Kether Posted June 5, 2017 Author Share Posted June 5, 2017 No one knows? Link to comment Share on other sites More sharing options...
Kether Posted July 16, 2017 Author Share Posted July 16, 2017 No one knows? Link to comment Share on other sites More sharing options...
Kether Posted July 21, 2017 Author Share Posted July 21, 2017 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 Link to comment Share on other sites More sharing options...
Recommended Posts