GWT: compile 減少編譯時間

來源:互聯網
上載者:User

GWT compile的時間很長,編碼》編譯》測試》修改,這樣的過程苦不堪言。
於是上網搜尋了一下如何減少GWT Compile,尤其是針對dev mode。
發布的時候,多等一會其實影響不大。

言歸正傳,根據GWT的特性,主要有兩個方面可以入手。
1. 更好的利用硬體

  • 如果你使用Ant,如果有多個module需要編譯,可以使用<pararell>來同時編譯幾個module。
  • 使用-localWorkers參數,制定GWTC利用多個線程來進行compile。

2. 簡化Permutation編譯
預設,GWT會針對不同的瀏覽器,產生不同的代碼,但是開發測試的時候,我們往往只用一種瀏覽器,比如Firefox。

  • 通過在module.gwt.xml中添加user-agent屬性,可以指定GWT只為特定瀏覽器產生頁面和代碼。針對Firefox,使用gecko1_8, 不要使用gecko。
  • 還可以制定locale,減少編譯輸出的檔案
  • 使用-draftCompile參數

3. 參考:

  • A Few Ways To Get Better GWT Compile Times
    http://supplychaintechnology.wordpress.com/2010/06/04/gwt_compile_times/
  • How to speed up the GWT compiler
    http://bazoud.free.fr/post/2008/07/31/can-i-speed-up-the-gwt-compiler/
  • Finding Supported GWT user.agent values
    http://www.mooreds.com/wordpress/archives/574
    http://stackoverflow.com/questions/890352/gwt-module-xml-how-to-redefine-and-use-more-than-one-user-agent

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.