1. #1
    Sencha User
    Join Date
    Jan 2011
    Posts
    77
    Answers
    1
    Vote Rating
    0
    riahut.com is on a distinguished road

      0  

    Default Unanswered: How to optimise Sench 2 applicaiton load time

    Unanswered: How to optimise Sench 2 applicaiton load time


    Hi All, I would like to know how can I accelerate loading time of sencha 2 application, and why during initialization it loads tons of classes I do not intend to use? Can I optimize that, skip classes I wont use?

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,801
    Answers
    3467
    Vote Rating
    834
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    If you use sencha-touch.js that is the basic framework without any widgets. In your class you should use the requires property and that will load the classes in the requires property
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Jan 2011
    Posts
    77
    Answers
    1
    Vote Rating
    0
    riahut.com is on a distinguished road

      0  

    Default


    Can you ellaborate a little bit more on that?
    Or may be tehre is reference document somewhere which explains how to use that?

    BTW my applicaiton is MVC applicaiton

  4. #4
    Sencha User
    Join Date
    Jan 2011
    Posts
    77
    Answers
    1
    Vote Rating
    0
    riahut.com is on a distinguished road

      0  

    Default


    I think there are some kind of problems going on with class loader ! after I switched to sencha-touch.js

    now I getting

    GET http://localhost:8080/app/app/Applic...=1327007523815 404 (Not Found)
    GET http://localhost:8080/app/event/Disp...=1327007523822 404 (Not Found)
    GET http://localhost:8080/app/dom/Compos...=1327007523823 404 (Not Found)
    GET http://localhost:8080/app/event/publ...=1327007523897 404 (Not Found)

    when I using sencha-touch-debug.js it is all perfect

    GET http://localhost:8080/common/js/senc...=1327007523815 200 (OK)
    GET http://localhost:8080/common/js/senc...=1327007523822 200 (OK)
    GET http://localhost:8080/common/js/senc...=1327007523823 200 (OK)
    GET http://localhost:8080/common/js/senc...=1327007523897 200 (OK)

    My applicaiton layout is
    common/ - for common stuff (common/js/sencha/src) all sencha sources
    app/ - for application files

    Why switching from sencha-touch-debug.js to sencha-touch.js changing lookup directory? Why class loader looking for classes in application directory???!!!!

  5. #5
    Sencha User
    Join Date
    Jan 2011
    Posts
    77
    Answers
    1
    Vote Rating
    0
    riahut.com is on a distinguished road

      0  

    Default


    In what section of the app I should add 'requires' ?

    Ext.Loader.setConfig({ enabled: true, disableCaching:true,
    requires: [
    'Ext.dom.CompositeElementLite',
    'Ext.event.Dispatcher',
    'Ext.event.publisher.Dom',
    'Ext.app.Application'
    ]
    });

    or in

    Ext.application({
    name: 'MyApp',

    requires: [
    'Ext.dom.CompositeElementLite',
    'Ext.event.Dispatcher',
    'Ext.event.publisher.Dom',
    'Ext.app.Application'
    ],

    controllers: ['Home'],
    models : ['Category', 'Content', 'Screenshot'],
    });

    both cases don't work
    Any ideas?

  6. #6
    Sencha User
    Join Date
    Jan 2011
    Posts
    77
    Answers
    1
    Vote Rating
    0
    riahut.com is on a distinguished road

      0  

    Default


    Seriously, I want to accelerate applicaiton load time, othervise it is useless!!

  7. #7
    Sencha - Sencha Touch Dev Team rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,158
    Answers
    93
    Vote Rating
    6
    rdougan will become famous soon enough

      0  

    Default


    Your application should only dynamically load classes in development. For production, you should compile your application so it has 1 .js file.

    More information here: http://robertdougan.com/posts/packag...ncha-sdk-tools
    Sencha Inc.
    Robert Dougan - @rdougan
    Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.

  8. #8
    Sencha User
    Join Date
    Jan 2011
    Posts
    77
    Answers
    1
    Vote Rating
    0
    riahut.com is on a distinguished road

      0  

    Default


    Thank you for the reply!

    I downloaded and followed the instructions.

    I've got app-all.js of 1.3mb !!! Is this kinda size all right? But not size bothering me, generated file was actually incomplete, despite fact it said "Done Building" without errors. As I understand all file entries from jsb3 file should end up in app_all.js. It actually stopped somewhere at the middle right after Ext.Container with still many classes to go.... hm ?

  9. #9
    Sencha User
    Join Date
    Jan 2011
    Posts
    77
    Answers
    1
    Vote Rating
    0
    riahut.com is on a distinguished road

      0  

    Default


    Newer mind, I've used wrong version of tools. As I understand I cannot use release version you have available and because I'm on windows I cant try 2.0.0 dev preview

  10. #10
    Sencha User
    Join Date
    Jan 2011
    Posts
    77
    Answers
    1
    Vote Rating
    0
    riahut.com is on a distinguished road

      0  

    Default


    Please correct me If I wrong,

    I see that sencha tool just concatenates js SDK files togather then all my js classes into oe humongous file....

    but why would I use just sencha-touch-all.js and my other five class files separately in order to accelerate application initialization time, that still will be great benefit versus class loader managing stuff!?

    Will Sencha 2 SDK tools do something better then just gluing sencha-touch-all.js with all my classes into one huge file ?

Thread Participants: 2

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi