1. #1
    Ext JS Premium Member dtex-lab's Avatar
    Join Date
    Sep 2009
    Location
    Italy
    Posts
    341
    Vote Rating
    1
    dtex-lab is on a distinguished road

      0  

    Default Minify Javascript and Client Performance Impact

    Minify Javascript and Client Performance Impact


    Hi
    I have doubt in my mind....

    Will Minify JS impacts Client Performance ? Maybe with better or worst performance..

    Of couse it is better for load perfomance... the file is smaller.. so less time to download it..

    But I have some question about JS engine.. will it be impacted ?

    I found a slide talking about it.. and seems that in same case it will impact client performance...
    I haven't idea using extjs minify files....

    I'm trying to profile my application.. it is very slow..
    What kind of profiler do you suggest ?
    I'm trying standard firefox and chrome progfiler and also the dynaTrace AJAX Edition (but it is based on IE and my application doesn't support it...)
    a best practise guide for performance will be very appreciate

    FYI. my application is a full J2EE ERP application based (about >950 EJB Entity Bean 2.1 , > 1200 EJB Session Bean, > 900 KB of JS code not minimized ......)

    ty
    Attached Images
    we make IT work for you

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,151
    Vote Rating
    674
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Simply minifying won't have any impact on the client. Essentially all it's doing is removing comments, whitespace and renaming variables to something smaller where it's appropriate.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Sencha User steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,664
    Vote Rating
    7
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about

      0  

    Default


    exactly, JS engine will behave the same.

    When app is slow it's mostly because of large requests or bad app design. I use Firebug to profile parts of code

    simple counter in functions: console.count('Title');
    profile: console.profile('title') and console.profileEnd()
    simple timer: console.time('name') and console.timeEnd('name');
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  4. #4
    Sencha - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364
    Vote Rating
    81
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    Quote Originally Posted by evant View Post
    Simply minifying won't have any impact on the client. Essentially all it's doing is removing comments, whitespace and renaming variables to something smaller where it's appropriate.
    I was under the impression that minification speeds up parsing. Removal of the whitespace and comments helps with the digestion of the code. Less whitespace & comments = faster interpretation.

    Though, I've never tested this myself

  5. #5
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854
    Vote Rating
    4
    tryanDLS is on a distinguished road

      0  

    Default


    As Jay said it will in some cases, depending on the level of compression speed up the client js processing. In addition to not parsing extra whitespace and comments, some compressors will drastically shorten var names to single chars, further reducing the memory footprint of the physical js in the browser

  6. #6
    Ext JS Premium Member dtex-lab's Avatar
    Join Date
    Sep 2009
    Location
    Italy
    Posts
    341
    Vote Rating
    1
    dtex-lab is on a distinguished road

      0  

    Default


    So at the end... minify javascript using a very good compression engine can be useful in order to have better performance... right or not ?

    are minify js distributed by ExtJS created with a "good" compression engine ?

    Of course I'm using FF profiler to check performance issue.. and I see that a lot of time is used in the getStyle.. getHeight getWidth and so on...

    I try to add suggestion from the following post:

    http://www.extjs.com/forum/showthrea...nt.removeClass
    http://www.extjs.com/forum/showthrea...up-Firefox-3.6
    http://www.extjs.com/forum/showthrea...etStyle-faster

    probably a problem in my application is that screen are very large.. a lot of fields....
    (and using Chrome is much much better.. )
    and I cannot set a fixed width / height

    a Question to the developer/support ExtJS Team.. using my subscription credit.... is it possible to have a support from you in order to help me to increase performance ? I can publish my application on internet of course...

    ty
    we make IT work for you

  7. #7
    Ext User OlleJonsson's Avatar
    Join Date
    May 2008
    Location
    Malmö, Sweden
    Posts
    30
    Vote Rating
    1
    OlleJonsson is on a distinguished road

      0  

    Default


    Quote Originally Posted by dtex-lab View Post
    So at the end... minify javascript using a very good compression engine can be useful in order to have better performance... right or not ?

    are minify js distributed by ExtJS created with a "good" compression engine ?
    http://en.wikipedia.org/wiki/Minific...programming%29 "the process of removing all unnecessary characters from source code, without changing its functionality"

    So, the output is not some compressed form of JavaScript, it is real, honest JavaScript.

  8. #8
    Ext User
    Join Date
    Aug 2009
    Posts
    127
    Vote Rating
    0
    rblon is on a distinguished road

      0  

    Default


    Quote Originally Posted by dtex-lab View Post
    So at the end... minify javascript using a very good compression engine can be useful in order to have better performance... right or not ?
    yes, but I would think the performance increase is mainly from smaller file size (ie less downloading), while quicker parsing (if any) would be just a little bonus.

    I have moved from Firebug to Chrome Developer Tools to debug/analyze my code, and up to now I haven't looked back.

  9. #9
    Sencha User steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,664
    Vote Rating
    7
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about

      0  

    Default


    I can suggest rockstarapps for compressing source in IDE on-the-flight, it's the simplest way to get it.
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  10. #10
    Ext User
    Join Date
    Aug 2009
    Posts
    588
    Vote Rating
    1
    Mike Robinson is on a distinguished road

      0  

    Default


    "Minifying" reduces transmission time, nothing more. "GZip" encoding of the HTML transfer, which can be requested using an HTML header, is usually far more effective ... if both the browser and the server in question support it.

    If the application is "noticeably slow," that will invariably turn out to be a logic problem, not something that can be addressed by "minifying" the source-code.

    It's also most reasonable to assume that the "slowdown" is caused by timing... by restarts, by timeouts, and by other similar timing-related issues in which the software will probably be seen to be idle most of the time (not "100% busy"). Modern CPUs, even on the most humble laptop, perform at blistering speeds.