3 Replies Latest reply on Mar 22, 2013 11:04 AM by Christian Sadilek

    Errai generated JavaScript size issue

    eladhr83 Newbie

      First of all I would like to say how much I was surprised  to find out about this project.
      currently we are in the stage of creating our GWT infrastructures (MVP , UI , Server comm...)  for a GWT CRM based solution.
      As part of investigating a solution for REST & GWT integration we found out about Errai.
      Its seems amazing but as part of our first integration task we decided to focus on one element – the DI.
      So we changed 3 different simple project from Gin to Errai DI (the ErraiBus is mandatory part of the Errai solution and we just added the DI and CDI Errai modules ).
      The effect on the generated JS sizes were about 3 times more than the Gin based solution.
      In large scale application specially  for mobile oriented solution this could be a show stopper.

      Are we doing anything wrong ?



      with errai , without errai

      1000k        300k

      1,570k       500k

      9.13m         2.68m

        • 1. Re: Errai generated JavaScript size issue
          Mike Brock Master

          What version of GWT and Errai are you using? Also, would you be able to share your SOYC report with us?

          • 2. Re: Errai generated JavaScript size issue
            eladhr83 Newbie

            good morning mike.


            GWT 2.5.0 ,, Errai - 2.2.0.Final


            Ok - i geneated the SOYC report and even in the bits and bytes you see the diff .


            the orignal GWT Project with (GWT MVP + Gin) size is - 500 KB

            after integration with Errai - about 1500 KB.


            after investigating the SOYC Report , lets take just one example ( java.util).



            java.util->java.util.AbstractHashMap->java.util.AbstractHashMap::$$init() - 23 bytes

            java.util->java.util.AbstractHashMap->java.util.AbstractHashMap::$$init()  - 71 bytes


            its seems like the most of the size diff is in same classes only 




            • 3. Re: Errai generated JavaScript size issue
              Christian Sadilek Master

              Hi Elad,


              In Errai 3.0, errai-ioc and errai-bus have been decoupled which will definitely make the JS smaller if you don't use both modules. Also, errai-jaxrs no longer depends on errai-ioc or errai-bus.


              So, if you're willing to use 3.0-SNAPSHOT you should definitely see an improvement.