JavaFX1.2的性能貌似有了很大的提升
程序员文章站
2022-03-13 15:01:23
...
Osvaldo Pinali Doederlein's Blog中提到,作者使用Bubblemark进行了一个简单的测试,JavaFX的性能较JavaFX1.1有了~16倍的提升,虽然比Swing还差一些,但已经可以接受(比Flash&Silverlight好很多)。
引用
Performance Results
Now let’s move to the fun part. These are my preliminary results with this “beta” JavaFX Balls code, running on the JavaFX 1.2 runtime:
* 16 Balls: 665fps (1.1 = 340fps; 1.2 is 1.95X faster)
* 128 Balls: 330fps (1.1 = 20fps; 1.2 is 16.5X faster)
* Adaptive mode (200fps): 221 Balls (1.1 = 30 Balls; 1.2 handles 7,3X more load). I could also get 560 Balls @ 60fps.
* Mobile (emulated), Adaptive mode (25fps): 91 Balls (1.1 = 82 Balls; 1.2 handles 11% more load)
JavaFX 1.2 has a completely rewritten animation core, and it shows. When I evaluated JavaFX 1.0, I complained and cried and whined about the poor scalability of its SceneGraph package, with the conclusion that JavaFX would “stand no chance” to implement serious animations (e.g. for action games, except for clones of trivial 1970's hits like Pac-Man). But this is now past.
The performance can be even bigger in a “pure” animation: I found that the controls are relatively heavyweight (even with caching). If I remove the control toolbar, I get 16 Balls @ 992fps (almost reaching the 1000fps cap), or 128 Balls @ 380fps. Even more interesting is CPU usage: the 16 Balls score consumed less than 1% CPU (Q6600), and even the 128 Balls score consumed only 16% CPU. So the program is clearly not constrained by CPU, but rather by other factors like timers or VRAM/DRAM bandwidth.
These results compare very favorably with most other Bubblemark contenders (both Java and other platforms). The very best score that I’ve seen before was for PulpCore: it scores 16 Balls @ 410fps, but 128 Balls @ 90fps only; and both saturated a full CPU core (25% of a quad-core). I tested again other competitors (including Flash and Silverlight 2), and they are all much worse than JavaFX in either FPS or CPU usage (often both).
Now let’s move to the fun part. These are my preliminary results with this “beta” JavaFX Balls code, running on the JavaFX 1.2 runtime:
* 16 Balls: 665fps (1.1 = 340fps; 1.2 is 1.95X faster)
* 128 Balls: 330fps (1.1 = 20fps; 1.2 is 16.5X faster)
* Adaptive mode (200fps): 221 Balls (1.1 = 30 Balls; 1.2 handles 7,3X more load). I could also get 560 Balls @ 60fps.
* Mobile (emulated), Adaptive mode (25fps): 91 Balls (1.1 = 82 Balls; 1.2 handles 11% more load)
JavaFX 1.2 has a completely rewritten animation core, and it shows. When I evaluated JavaFX 1.0, I complained and cried and whined about the poor scalability of its SceneGraph package, with the conclusion that JavaFX would “stand no chance” to implement serious animations (e.g. for action games, except for clones of trivial 1970's hits like Pac-Man). But this is now past.
The performance can be even bigger in a “pure” animation: I found that the controls are relatively heavyweight (even with caching). If I remove the control toolbar, I get 16 Balls @ 992fps (almost reaching the 1000fps cap), or 128 Balls @ 380fps. Even more interesting is CPU usage: the 16 Balls score consumed less than 1% CPU (Q6600), and even the 128 Balls score consumed only 16% CPU. So the program is clearly not constrained by CPU, but rather by other factors like timers or VRAM/DRAM bandwidth.
These results compare very favorably with most other Bubblemark contenders (both Java and other platforms). The very best score that I’ve seen before was for PulpCore: it scores 16 Balls @ 410fps, but 128 Balls @ 90fps only; and both saturated a full CPU core (25% of a quad-core). I tested again other competitors (including Flash and Silverlight 2), and they are all much worse than JavaFX in either FPS or CPU usage (often both).
上一篇: 清朝后宫选妃到底是什么样的 皇帝看中的是颜值还是身材
下一篇: 盘点:汉末三国时期额程姓人物?