1. #41
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,632
    Vote Rating
    817
    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 your grid needs to display data a different way than what is given, isn't that a view thing not a data thing?
    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.

  2. #42
    Ext JS Premium Member
    Join Date
    Feb 2009
    Posts
    440
    Vote Rating
    2
    Jangla is on a distinguished road

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    If your grid needs to display data a different way than what is given, isn't that a view thing not a data thing?
    Well, standard aside, my question really comes down to performance? Rearrange the data a dozen different ways in the store and use a templatecolumn or have the minimum neccessary fields in the store and use a rendered on the column which call a function to arrange data for you and apply it to a tpl?

  3. #43
    Sencha Premium Member vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Chisinau, Moldova
    Posts
    642
    Vote Rating
    25
    vadimv will become famous soon enough vadimv will become famous soon enough

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    If your grid needs to display data a different way than what is given, isn't that a view thing not a data thing?
    Yes. I missed to write that depends on the case. An example to what I said is: I have one model with a 'name' field, and I can't control how server data is returned, and is one store per view.
    Code:
                { name: 'name', type: 'string', convert: function(v,record){
                    switch(record.raw.evtype){
                        case "MOTION":
                        case "DISCONNECT":
                        case "RECONNECT": {
                            return record.raw.camera_name;
                        }
                        case "ACCESS_CONTROL" : {
                            return record.raw.ac_dev_name + ':' + record.raw.ac_user_name;
                        }
                        case "PARTITION-CHANGED-STATUS" :
                        case "ZONE-CHANGED-STATUS" :{
                            return record.raw["orig.name"]
                        }
                        case "SMS":
                        case "MMS":
                        case "MAIL": {
                            return record.raw.dest;
                        }
                    }
                }}

  4. #44
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,632
    Vote Rating
    817
    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

      2  

    Default


    Best performance is to get the data exactly how you want from the server. After that it's best to do it in the model. Lastly the view.

    Just depends on what you are going to be doing with the data as there isn't a silver bullet to work with all use cases. For example, say you have 15 views using the same store (yes, I've done it and more for enterprise needs) but not all of them may display; maybe 7 of them get displayed for a particular user session, the other 8 aren't used very much. Are you going to bloat your data to fit all 15 views or should each view handle itself. If you used a convert function and added extra fields to the model then you have a large up-front performance hit where as if you did it in the views it would be smaller performance hits as the application is used. Sure the smaller hits may add up to more than the up-front hit but since it's spread out over the application usage it isn't felt by the user as much as the up-front hit is.
    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.

  5. #45
    Sencha Premium Member vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Chisinau, Moldova
    Posts
    642
    Vote Rating
    25
    vadimv will become famous soon enough vadimv will become famous soon enough

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    Best performance is to get the data exactly how you want from the server. After that it's best to do it in the model. Lastly the view.
    very well said

  6. #46
    Sencha User
    Join Date
    Apr 2013
    Posts
    2
    Vote Rating
    0
    logn is on a distinguished road

      0  

    Default


    We have noticed that using the compiled version of Sencha is 10-15x faster. Also storing html locally v/s loading it from the server is obviously much faster

  7. #47
    Sencha Premium Member natedsaint's Avatar
    Join Date
    Jul 2012
    Location
    Fort Worth, TX
    Posts
    21
    Vote Rating
    3
    natedsaint is on a distinguished road

      0  

    Question Regarding card/tab layout optimizations by deleting invisible nodes

    Regarding card/tab layout optimizations by deleting invisible nodes


    mitchellsimoens originally offered up the concept of removing tabs or cards that were not visible.

    Our team is interested in this concept, as we are in the process of moving from a "desktop" layout with individual windows to one that uses a card layout to swap between the views. To make for a better UX, we are considering not forcing the user to "close" the cards they aren't looking at, so they can just focus on the task at hand rather than managing a slew of windows/cards/tabs/whatever. This could potentially mean a big memory footprint, but in testing it seems to be well within the thresholds we can handle. The real problem is the hugely cluttered DOM, which is now full of hidden elements, and I imagine the event listeners that are polling with no results (though I'm not as familiar with those types of optimizations so I could just be stretching there).

    When you mention "deleting" the views not visible, are you talking about creating an override or modification to the card layout that removes the dom nodes and caches them somewhere for re-entry? If so, how can you re-add event listeners and cache references/etc after an Ext.removeNode has occurred? Or are you more specifically saying that you completely delete everything and force a re-load if they re-visit those tabs/cards later? Or are you talking about something completely different? Can we see a code example?

    Thanks for your ideas, this thread is pretty great.

  8. #48
    Touch Premium Member
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    1,299
    Vote Rating
    109
    LesJ is a glorious beacon of light LesJ is a glorious beacon of light LesJ is a glorious beacon of light LesJ is a glorious beacon of light LesJ is a glorious beacon of light LesJ is a glorious beacon of light

      1  

    Default


    This is a generic JS perf tip, but a good one

    Always tell JS that your instance is going to have a certain property

    http://jsperf.com/prealloc-vs-no-prealloc

  9. #49
    Sencha User
    Join Date
    Mar 2008
    Location
    Brazil
    Posts
    73
    Vote Rating
    5
    fabio.parra is on a distinguished road

      1  

    Default


    Quote Originally Posted by LesJ View Post
    This is a generic JS perf tip, but a good one

    Always tell JS that your instance is going to have a certain property

    http://jsperf.com/prealloc-vs-no-prealloc
    V8 is optimized for this

    http://www.html5rocks.com/en/tutorials/speed/v8/

  10. #50
    Sencha User
    Join Date
    Apr 2014
    Posts
    1
    Vote Rating
    0
    manlystanley is on a distinguished road

      0  

    Default


    I'm new to EXT JS, but having done years of embedded systems development. Always, the rule of thumb for increased performance was never copy data (e.g. never move it from point to point, or reformat it in anyway). In looking over the various comments here, that seems to be the jest of many comments.

    A second group of comments seems to be don't use certain EXTJS functions over other EXTJS functions. I wonder if this just boil down to two main points:

    -- Don't reformat or move data.
    -- Don't use expensive EXTJS functions.

    Would this be a correct statement?

    Thanks, Stan