Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    GWT compiler and optimisation

    Hi,

    Just wanted to gain a quick understanding of the compilation process, and its implications.

    One of the key advantages I was hoping for with SmartGWT was some intelligent compilation that would reduce the footprint of the deployed client app. Compiling HelloWorld, I note that we get 4373 files, including 3 different skins in the output. Obviously SmartGWT is in its first beta, and was brought out with astounding speed, so its understandable that compiler optimisation is not a focus - but do you expect that the compilation output will get leaner as SmartGWT matures?

    I am deploying to Google Application Engine, which has some pretty strict file count and size limitations for deployed applications. I had been doing some pretty heavy culling and zipping while using SmartClient to get under these restrictions - and for the time being it looks like I will need to do something similar with the SmartGWT build.

    Would you be able to comment on this aspect of SmartGWT? Cheers.

    #2
    Hi,
    You're right. The priority of this first release was feature completeness, stability, runtime performance and trying to get it out to users at the earliest with these factors in mind.

    For the next release they'll be a bunch of optimizations.

    Regarding the skins, each skin will be packaged as a separate module so the user can inherit only the desired skin(s) in their application module file. This way the compile output will only consist of required skins. Use of ImageBundle's is also a high priority and when this makes it in, the number of bundled images and performance will also improve.

    On the inclusion on scripts, the dependency tree of the various components is documented so I'm hoping to allow users to selectively include the desired components and with the use of a GWT linker, output a highly optimized subset of the script required on compile.

    Feel free to post any suggestions.

    Sanjiv

    Comment


      #3
      Thanks Sanjiv - that all sounds ideal :).

      Comment


        #4
        showstopper

        The GAE file count limitation is really a showstopper for smartGWT.

        I was -really- looking forward to using smartGWT on GAE but now I have to manage without it.

        Without going into advanced plumbing; Are there certain files I can safely discard as I will only be using e.g. RestDataSource, a simple grid, a form and some buttons in my app?

        Comment


          #5
          Note there's going to be a "lean" skin available for this kind of usage - SmartClient already has a lean skin called "standard" but it's not packaged with SmartGWT as yet.

          If you look into the skins for SmartGWT, you can remove the skins you aren't using, and in the skin you are using, you can remove every image directory that is named after a component you aren't using, as well as images/shared/shadows if you disable dropShadows, and images/edges if you are happy with non-rounded Windows and Dialogs and such. If you use Button rather than IButton you can also delete the entire "button" directory (you only need the files under cssButton).

          If you look at load_skin.js you can also prevent components from showing "Focused" as a distinct state (showFocused:false) and then remove all media related to this state (anything that contains "Focused" in the name).

          BTW, hawkettc, did you already go through this trimming process? Maybe you have files you can share?

          Comment


            #6
            Excellent pieces of advice. Thanks.

            Here's what I ended up with (Because I wouldn't go for a lean skin if I can have it all):

            Google already provides a zipserve functionality, and its documented at http://code.google.com/p/googleappen...ve/__init__.py

            Although the number of files decrease dramatically, the size of the zip-file is the next headache (GAE ignores zip files bigger than a mb).

            The trick is to catch request paths and direct requests to small-enough zip-files. Here's my main.py(thon) code:

            Code:
            application = webapp.WSGIApplication(
                                                [
                    ('/', MainPage),
                    ('/sc/skins/(.*)', zipserve.make_zip_handler('sc_skins.zip')),
                    ('/sc/system/widgets/form/(.*)', zipserve.make_zip_handler('sc_system_widgets_form.zip')),
                    ('/sc/system/widgets/(.*)', zipserve.make_zip_handler('sc_system_widgets.zip')),
                    ('/sc/system/(.*)', zipserve.make_zip_handler('sc_system.zip')),
                    ('/sc/(.*)', zipserve.make_zip_handler('sc.zip')),
                                                ],
                                                 debug=True)
            Where:
            sc_skins.zip contains the "SilverWave" directory and all of its contents.
            sc_system_widgets_form.zip contains the -contents- of the "form" dir
            sc_system_widgets.zip contains all widgets except form widgets.
            sc_system.zip contains every "sc/system" content except widgets
            sc.zip contains all sc contents except "skins" and "systems" directories.

            Additionally, as I use "/gwtStart/...Application.nocache.js" as application base path, some files need to be reachable from static files:
            (OK, this can possibly be done using the technique above, but I am too tired to try it right now)
            I started off changing my app.yaml file:

            - url: /gwtStart
            static_dir: static/gwt

            In that static dir I put -every- GWT file except "skin" images and "system" widgets (I think)

            Well, now I can upload to GAE and run my app successfully.
            Last edited by Peter Odéus; 6 Jan 2009, 13:36.

            Comment


              #7
              Do you guys have an estimated date to work on optimizing smartgwt?

              Comment


                #8
                egghunt: what kind of optimization is important for you?

                Comment


                  #9
                  SmartGwt application size in unacceptable for public high traffic websites

                  If you you make a simple app in smartgwt ... size goes to 2-3 mb ..........you can expect users to wait so much time to download app ............even flex has less size than this ...........GWT widgets are just in KB ....why can you guys otimize it ? ............can we reduce the size of core lib dynamically as its already huge around 400 kb as needed by application ?

                  Comment


                    #10
                    Optimization

                    Originally posted by Isomorphic
                    egghunt: what kind of optimization is important for you?
                    Reduce the file size ...................so that smartclient can be used in high traffic public websites rather than corporate LAN applications

                    Comment


                      #11
                      Any way reduce size of core lib ?

                      is there any way to reduce size of core lib

                      Comment


                        #12
                        When will be this release ?

                        Originally posted by sjivan
                        Hi,
                        You're right. The priority of this first release was feature completeness, stability, runtime performance and trying to get it out to users at the earliest with these factors in mind.

                        For the next release they'll be a bunch of optimizations.

                        Regarding the skins, each skin will be packaged as a separate module so the user can inherit only the desired skin(s) in their application module file. This way the compile output will only consist of required skins. Use of ImageBundle's is also a high priority and when this makes it in, the number of bundled images and performance will also improve.

                        On the inclusion on scripts, the dependency tree of the various components is documented so I'm hoping to allow users to selectively include the desired components and with the use of a GWT linker, output a highly optimized subset of the script required on compile.

                        Feel free to post any suggestions.

                        Sanjiv

                        hi sanjiv any idea how time it would take for above mentioned release ..........if its going to take lot of time than can pl give pointers on how to do such optimization manually ...........i am making POC and I need to give demo for management approval...i am also need application size to be 200 kb range ........thanks

                        Comment

                        Working...
                        X