javafx端口app的性能不佳 [英] Poor performance of javafx ported app

查看:168
本文介绍了javafx端口app的性能不佳的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚使用gradlew移植到一个名为PuzzlePieces的示例netbeans javafx项目中。应用程序性能太差,导致什么原因?

I just ported using gradlew into android a sample netbeans javafx project called "PuzzlePieces". The app has got soo poor performance, what can cause that?

我的设备:LG E975,4.4 kitkat

My device: LG E975, 4.4 kitkat

推荐答案

问题包含一些可能的原因根据应用程序在桌面上运行的方式,Android设备上的性能可能会很差。

This question contains some possible reasons why performance on an Android device could be poor in terms of what one could expect based on how the app runs on desktop.

无论如何,PuzzlePieces中有一个快速的胜利,它与该问题中提到的CSS点有关。

Anyway, there is a quick win in "PuzzlePieces", and it is related to the CSS point mentioned in that question.

Desk 类添加了这种内联样式:

The Desk class adds this inline styling:

Desk(int numOfColumns, int numOfRows) {
        setStyle("-fx-background-color: #cccccc; " +
                "-fx-border-color: #464646; " +
                "-fx-effect: innershadow( two-pass-box , rgba(0,0,0,0.8) , 15, 0.0 , 0 , 4 );");

如果您只是删除效果:

Desk(int numOfColumns, int numOfRows) {
        setStyle("-fx-background-color: #cccccc; " +
                "-fx-border-color: #464646; ");

你应该注意到性能的巨大增长。

you should notice a huge increment in performance.

根据经验,在将桌面应用程序移植到移动设备时,请避免使用过多的CSS样式,尤其是避免不惜一切代价降低css效果

As a rule of thumb, when porting desktop applications to mobile devices, avoid excessive css styling, and particularly, avoid at all cost css effects.

我没有试过缓存,但这可能也有帮助。

I haven't tried cache with the pieces, but probably this will help as well.

值得一提的是,CPU也很重要......

And it's worth mentioning as well, CPU will matter...

这篇关于javafx端口app的性能不佳的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆