`
flashcloud
  • 浏览: 185256 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

MVP For GWT 系列资料转载三:How to reduce startup time with gwt-presenter

    博客分类:
  • GWT
 
阅读更多

源文转自:How to reduce startup time with gwt-presenter

 

I’ve finally figured out a way to trim down the initial load time for my app. I’m not quite ready for GWT 2, runAsync(), or the new Place API in gwt-presenter, but I’ve been able to cut my initial load time significantly (from 14s to 2s) by doing some lazy loading within my presenters and views. In a nutshell, here’s how it works:

 

I now do nothing in the constructor and bind() methods of each presenter and view.

Instead, I’ve created a new method onFirstRequest() in my base presenter. It gets called on the first invocation of onPlaceRequest(), which simply increments a counter in a class field to keep track.

I’ve added an init() method to the base presenter’s Display interface. It gets called by onFirstRequest(). I moved all widget creation in my views from the constructor and onBind() methods into this init() method instead, thus delaying all widget creation until the first time the view is accessed.

Following a suggestion from Per Wiklander in a recent comment to this blog, I noop’d the addWidget() method in my WidgetContainerDisplay class. This method gets called for each presenter that you add to a WidgetContainerPresenter, which doesn’t make sense for the way I’m using the container (I show only one view at a time). The addWidget() method is not used for anything else.

Since this particular scheme utilizes onPlaceRequest() to keep track of the first invocation, it will only work if you first reveal a view by firing the corresponding PlaceRequentEvent, either in code or by visiting the place URL.

分享到:
评论

相关推荐

    GWT简介.docx

    NULL 博文链接:https://mydownload.iteye.com/blog/1157105

    gwt-widgets-server1.1.jar

    GWT整合Spring时需要这个包,在官网上没有最新的jar包,这是自己用jar命令生成的,并测试可以使用。

    Ext GWT 2.0, Beginner's Guide.pdf

    Ext GWT 2.0: Beginner's Guide is a practical book that teaches you how to use the Ext GWT library to its full potential. It provides a thorough, no-nonsense explanation of the Ext GWT library, what ...

    基于Google.App.Engine(GAE)的Java和GWT应用开发.pdf

    This book is designed to give developers all the information they need to develop their own GAE+GWT applications, with a particular focus on some of the technologies useful for building scalable ...

    gwt-maven-plugin:旧版GWT Maven插件

    现在,该插件被认为是legacy GWT maven plugin (又名mojo GWT maven插件),而新插件被认为是new generation GWT maven plugin (又名tbroyer GWT maven插件)。 仍然支持旧版maven插件,但强烈建议将新插件用于新...

    gwt入门-gwt从这里开始

    C:\程序开发\Java\gwt-windows-1.4.59 doc(文档目录,开发文档和Java API文档) samples(示例代码目录,非常有名的KitchenSink示例代码即在此目录中) about.html about.txt applicationCreator.cmd ...

    GWT in Action

    Chapter 10 takes you into the world of GWT-RPC, where you’ll learn how to pass Java objects between the web browser and your Java servlets. ABOUT THIS BOOK xxvii Chapter 11 expands on the previous ...

    Maven2 + gwt 详细配置指南.doc

    变量值:D:\project tools\gwt-windows-1.4.60 变量注:这个变量指定GWT的存放路径 二、把下面的两段分别接到环境变量path与classpath 的最后面 path: ;%MAVEN_HOME%\bin;%GWT_HOME;%JAVA_HOME%\bin;%...

    gwt-ex t学习必备资料

    gwt ext gwt-ext gwt-ex t学习必备资料gwt ext gwt-ext gwt-ex t学习必备资料gwt ext gwt-ext gwt-ex t学习必备资料gwt ext gwt-ext gwt-ex t学习必备资料gwt ext gwt-ext gwt-ex t学习必备资料gwt ext gwt-ext gwt-...

    gxt-2.1.1-gwt2 最新的

    gxt-2.1.1-gwt2gxt-2.1.1-gwt2gxt-2.1.1-gwt2gxt-2.1.1-gwt2gxt-2.1.1-gwt2gxt-2.1.1-gwt2gxt-2.1.1-gwt2gxt-2.1.1-gwt2gxt-2.1.1-gwt2gxt-2.1.1-gwt2gxt-2.1.1-gwt2gxt-2.1.1-gwt2

    GWT工具GWT工具GWT工具GWT工具GWT工具GWT工具

    fwefwefwGWT工具GWT工具GWT工具GWT工具GWT工具GWT工具

    gwt-maven-plugin:开始使用Maven构建GWT项目

    gwt-maven-plugin 该插件旨在通过提供两种特定的打包方式: gwt-lib和gwt-app ,使使用Maven构建GWT项目更加容易。 基本用法 将插件添加到您的POM并启用扩展: < groupId>net.ltgt.gwt.maven</ groupId> ...

    gwt-websocket-exercise:用于GWT培训的简单GWT Websocket练习

    gwt-websocket-exercise 用于GWT培训的简单GWT Websocket练习 依赖于realityforge的gwt-websocket实现: 在Eclipse中设置Realityforge / gwt-websockets项目 在项目中:在类路径上添加GWT SDK,启用GWT支持 删除...

    gwt-dev-plugin for Firefox3.0.xpi

    GWT调试插件,适用于firefox3.x GWT浏览器插件 gwt-dev-plugin for Firefox3.0

    gwt-dev-plugin-1.26-rc1.xpi for firefox插件

    原地址如下 http://google-web-toolkit.googlecode.com/files/gwt-dev-plugin-1.26-rc1.xpi

    cypal.studio.for.gwt-1.0

    cypal.studio.for.gwt-1.0

    gwt-dev-plugin for IE、FireFox、Chrome

    gwt-dev-plugin是GWT针对浏览器的安装插件,包含IE、FireFox、Chrome的。不需要的匆下,非学习文档

    最好的gwt-ext学习资料

    最好的gwt-ext学习资料,适合初学者。

    GWT-Developer-Plugin

    GWT-Developer-Plugin

Global site tag (gtag.js) - Google Analytics