Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

    Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    974
    Vote Rating
    107
    Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all

      0  

    Default [4.1.1 GA] Field setValue() performance issue

    [4.1.1 GA] Field setValue() performance issue


    REQUIRED INFORMATION

    Ext version tested:
    • Ext 4.1.1 GA
    Browser versions tested against:
    • Chrome 21.0.1180.60 m
    • FireFox 14.0.1, FireBug 1.10.0
    • IE 9.0.8112.16421
    Description:
    • I discovered a performance issue when just clear many fields (for example, 20). To clear the fields I use "field.setValue();" The fields are within a FormPanel. And there is a noticeable delay before clearing the fields. The FireBug profiler says: Profile (790.517ms, 101363 calls). In other browsers - IE9, Chrome - more or less the same (by eye). One hundred thousands calls confuse a bit.
    • It seems each field causes FormPanel relayouting and "Ext.suspendLayouts();" before clearing and "Ext.resumeLayouts(true);" after clearing extremelly help: Profile (121.797ms, 9479 calls). Without "true" "Ext.resumeLayouts();" gives even a much better result: Profile (51.524ms, 4715 calls) and, seems, doesn't break anything.But does it not function better without these things?
    Steps to reproduce the problem:
    • Run the sample
    • Click the button
    The result that was expected:
    • I expect clearing should be done without any noticeable delay.
    The result that occurs instead:
    • I notice some delay before clearing.
    Test Case:

    Code:
    <html>
    <head>
        <title>NumberField Clear Collapsible</title>
    
        <link type="text/css" rel="stylesheet" href="../resources/css/ext-all.css" />
    
        <script type="text/javascript" src="../ext-all-debug.js"></script>
    
        <script type="text/javascript">
            Ext.onReady(function () {
                var items = [];
    
                for (var i = 0; i < 20; i++) {
                    items.push({
                        xtype: "numberfield",
                        hideTrigger : true,
                        value: i,
                        fieldLabel: "NumberField " + i,
                        allowBlank: false
                    });
                }
    
                new Ext.form.FormPanel({
                    renderTo: Ext.getBody(),
                    width : 300,
                    items: items,
                    buttons: [{
                        text: "Clear",
                        handler: function () {
                            //Ext.suspendLayouts();
                            this.up("form").items.each(function (field) {
                                field.setValue();
                            });
                            //Ext.resumeLayouts(true);
                        }
                    }]
                });
            });
        </script>
    </head>
    <body>
    
    </body>
    </html>


    HELPFUL INFORMATION


    Possible fix:
    • As I mentioned before:
    Code:
    Ext.suspendLayouts();
    this.up("form").items.each(function (field) {
        field.setValue();
    });
    Ext.resumeLayouts(true); // without "true" gives even a much better result and, seems, doesn't break anything
    Operating System:
    • Windows 7

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,609
    Vote Rating
    580
    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


    You're right, you should be calling suspendLayouts when doing a "bulk" operation like this, however there's no way we can predict whether you're going to do such a thing, so it's not really possible to anticipate it. When you set the value it triggers a layout because it may need to update because of errors and such.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    974
    Vote Rating
    107
    Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all

      0  

    Default


    Hi Evan,

    Thanks for a prompt response! I predicted such answer

    Well, no problem, good to know.

    Just a thing I would like to clarify.

    Can I use "Ext.resumeLayouts();" without the "true" argument or should I avoid it at all?

    Generally, I can't see any noticeable background effect (I mean no layout issues), but can I be sure they won't appear?

  4. #4
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,609
    Vote Rating
    580
    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


    Code:
    Ext.require('*');
    
    Ext.onReady(function() {
        var items = [];
    
        for (var i = 0; i < 20; i++) {
            items.push({
                xtype: "numberfield",
                hideTrigger: true,
                value: i,
                fieldLabel: "NumberField " + i,
                allowBlank: false
            });
        }
    
        new Ext.form.FormPanel({
            renderTo: Ext.getBody(),
            width: 300,
            items: items,
            listeners: {
                afterlayout: function(){
                    console.log('layout');    
                }
            },
            buttons: [{
                text: "Clear",
                handler: function() {
                    var form = this.up('form');
                    Ext.suspendLayouts();
                    form.items.each(function(field) {
                        field.setValue();
                    });
                    Ext.resumeLayouts();
                    Ext.AbstractComponent.cancelLayout(form);
                    debugger;
                    p.setWidth(100);
                }
            }]
        });
        
        var p = new Ext.panel.Panel({
            width: 100,
            height: 100,
            title: 'X',
            renderTo: document.body
        });
    });
    Here's a short sample. As you step through it the code inside Component::updateLayout (the static one), you'll see the form has a pending layout. Try toggling the call to cancel on/off. I'm not sure if:

    a) There's a way to prevent a layout from being queued up in this case
    b) Whether we can do so without any issues

    A majority of the time you want to suspend and them flush everything at once as opposed to cancelling a layout. You can certainly cancel the layout on the form and it's no longer pending, but this is a bit unintuitive for the developer to call because it requires you to know exactly what was queued up after you performed those setValue calls.

    Anyway, will chat with Don about it and will let you know.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  5. #5
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    974
    Vote Rating
    107
    Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all

      0  

    Default


    Thanks for the sample, clear and interesting.

    Quote Originally Posted by evant View Post
    You can certainly cancel the layout on the form and it's no longer pending, but this is a bit unintuitive for the developer to call because it requires you to know exactly what was queued up after you performed those setValue calls.
    Yes, it appears to be a problem. I don't know for sure I can cancel layout and don't lose anything in the layout.

    Well, if a setValue call causes re-layouting, hence it is no accident So, seems, it would be best just live with Ext.resumeLayouts(true).

    Anyways, I am looking forward to know a result of your discussion with Don.

  6. #6
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,609
    Vote Rating
    580
    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

      1  

    Default


    This is sort of a special case since qtip/title errors don't actually need to perform a layout. As such, we'll be changing this out so it only triggers a layout when necessary.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  7. #7
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    974
    Vote Rating
    107
    Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all

      0  

    Default


    Great, thanks!

    Please clarify, will you open a ticket for that? Is there any time frame?

  8. #8
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,609
    Vote Rating
    580
    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


    For that specific case, yeah, I've made a change so it will only trigger a layout if the msgTarget is side/under.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  9. #9
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    974
    Vote Rating
    107
    Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all

      0  

    Default


    That's great, thanks! Will it be included in the next official release, isn't that so?

  10. #10
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,609
    Vote Rating
    580
    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


    You got it, next release. Xorosho!
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

Thread Participants: 1