I’ve been having some problems in GWT with a table pulling 100+ rows at a reasonable speed using the FlexTable, but before making massive changes by switching to a Grid I ran some tests comparing the two. I originally found this issue when testing on IE for the first time after having no problems with FF.
Here’s the basic code used:
long startTime = System.currentTimeMillis();
for (int i = 0; i < names.length; i++) {
NameData nd = names[i];
grid.setText(i, 0, nd.getName());
grid.setText(i, 1, Double.toString(nd.getD1()));
grid.setText(i, 2, Double.toString(nd.getD2()));
grid.setText(i, 3, Integer.toString(nd.getRank()));
}
gridLabel.setText("Grid: "+(System.currentTimeMillis()-startTime)+"ms");
startTime = System.currentTimeMillis();
for (int i = 0; i < names.length; i++) {
NameData nd = names[i];
flex.setText(i, 0, nd.getName());
flex.setText(i, 1, Double.toString(nd.getD1()));
flex.setText(i, 2, Double.toString(nd.getD2()));
flex.setText(i, 3, Integer.toString(nd.getRank()));
}
flexLabel.setText("FlexTable: "+(System.currentTimeMillis()-startTime)+"ms");
I’m pulling from an array of 100 which holds some data that’s used to populate the cells. The creation of the tables is done before hand, I’m not sure if this gives an unfair advantage to the Grid, but that’s the way I’m doing it.
Try the test app yourself here .
Results
What I’m finding is that the Grid does beat the FlexTable, but not by much with a small data set. Larger sets seem to widen the gap. My guess for this is that since FlexTable has the ability to add rows (Grid is sized from the start) that it works much like how other resizable constructs work such as Java’s ArrayList. My reasoning for this is that the first time the test is run the speed is very slow on the FlexTable (especially in IE). Repeated test runs after the initial are faster and I think this is because the table was being sized the first time as rows were added, and didn’t need to be resized during the following tests. MS Windows Machine
Linux Machine
The other thing I’m finding is that performace varies based on browser. I’m seeing FF run reasonably well. With IE the Grid runs about the same as FF but the FlexTable runs considerably slower. I also tested Opera and was stunned as it blew both others out of the water.
Here’s some of the tests run with two different machines (one linux and one Windows):
|
FF |
FF |
IE |
IE |
|
Grid |
FlexTable |
Grid |
FlexTable |
Run 1 |
147ms |
198ms |
156ms |
1297ms |
Run 2 |
131ms |
158ms |
156ms |
203ms |
Run 3 |
150ms |
176ms |
156ms |
172ms |
|
FF |
FF |
Opera |
Opera |
|
Grid |
FlexTable |
Grid |
FlexTable |
Run 1 |
89ms |
244ms |
37ms |
118ms |
Run 2 |
85ms |
115ms |
31ms |
41ms |
Run 3 |
86ms |
115ms |
28ms |
41ms |
reprint: http://whatwouldnickdo.com/wordpress/401/performance-grid-vs-flextable/
分享到:
相关推荐
Accelerated GWT: Building Enterprise Google Web Toolkit Applications
自己写的smartgwt的grid分页组件
Grails GWT插件介绍Google Web Toolkit (GWT) 是一种高级 AJAX 框架,允许您使用 Java 开发丰富的用户界面,从而利用类型... plugins { build ":extended-dependency-manager:0.5.5" compile ":gwt:1.0.3", { transit
GWT 使用 Google GWT 框架的 TIPL 的基于 Web 的 GUI。 跑步 Maven mvn gwt:run
GWT GWT是GWT 2.5及更高版本的官方开源项目。 在本文档中,您将获得一些快速说明,以根据源代码构建SDK并运行其测试。 有关更详细的文档,请访问我们的。 如果您有兴趣为该项目做贡献,请阅读部分。构建GWT SDK: ...
请注意,此库现在在Harmonia ... JsFunction API是Cesium-GWT的一部分,但已分解为一个单独的库,可用于多种用途(包括在OZONE Widget Framework的OWF-GWT API中使用)。 可以在找到项目页面,包括“ To Dos”。 您可
Spring Boot GWT 这是一个演示项目,用于展示Spring Boot与GWT的结合。 它使用最新的依赖关系(Spring Boot 2.0.1和GWT 2.8.2)和Java8。可以在找到已部署的应用程序。跑要运行该项目,您必须分别启动Spring Boot和...
NPESDK_GWT NPESDK GWT 实用程序库 在线演示页面在这里! 执照 在 MIT 许可下发布。 入门 下载 npesdk-gwt-1.0.jar 并编辑 yourproject.gwt.xml。 < inherits name = ' net.npe.gwt '> 画布创作者 CanvasCreator ...
通用部件-gwt gwt 小部件库
Ext GWT 2.0: Beginner's Guide pdf 和源码,重点推荐学习GWT-EXT的入门资料,英文版的
彗星d4gwt 由 GWT 完成现有的 CometD 项目Cometd4Gwt? 使用 GWT 的 JSNI 来包装现有 CometD 项目的 JavaScript? 客户端并利用 GWT 现有的序列化框架将对象(实现 IsSerializable?)从服务器传输到客户端。 源代码...
Vue GWT使用和将与集成。 它使您可以用Java编写Vue组件。产品特点具有Java控制器的Vue.js组件编译时检查模板表达式的类型支持HTML模板在Java编译期间进行编译(仅需要Vue.js运行时) 在模板中使用常规的Java对象和...
谷歌图表-gwt GWT 的 Google 图表(已弃用) Google Charts Image API 是一个有用的图表 API,它为 Web 和移动应用程序提供轻量级图表。 不需要 javascript/flash/CSS 技巧,只需一个由 URL 驱动的页面上的图像。 ...
log4j-gwt使GWT客户端可以使用log4j Logger,并受益于log4j的灵活性和便捷的方法。 使用log4j-gwt,记录的消息被路由到GWT的内部记录API。
emfjson-gwt EMF-GWT的JSON绑定。文献资料参见下载我们建议使用maven-gwt插件。 在Maven Central中提供了emfjson的GWT版本。 < dependency>< groupId>org.emfjson</ groupId>< artifactId>emfjson-gwt</ artifactId>...
RxPong GWT GWT中的使用支持的React式编程风格。 来自原始想法,由出于学习目的重新
开发GWT应用程序的开发人员可以使用OWF-GWT来更轻松地将其GWT小部件添加到OWF环境中,使用Java API和Java IDE扩展其应用程序的OWF发布/订阅通道,代理方法和意图,以及自动启动小部件和其他功能,可将应用程序显示...
ChargeIO 支付网关的 GWT API
gss.gwt 该项目旨在在 GWT 中引入对支持。 GSS 支持现在包含在,因此该存储库将不再更新。 请参考