[FIXED] [#1378] [4.2.0] Tagfield memory cpu problem

  1. #1

    [FIXED] [#1378] [4.2.0] Tagfield memory cpu problem

    Hi,
    There seems to be a problem with the tagfield control.

    My page was taking up a lot of cpu usage and i finally narrowed it down to the tagfield.

    if you run the following code...

    
            <ext:ResourceManager runat="server"></ext:ResourceManager>
            <ext:TagField runat="server" ID="dd"></ext:TagField>
            <ext:TagField runat="server" ID="TagField1"></ext:TagField>
            <ext:TagField runat="server" ID="TagField2"></ext:TagField>
            <ext:TagField runat="server" ID="TagField3"></ext:TagField>
    and then click on one of the tagfields you will see cpu usage for the browser go up and stay up even when page is idle (about 5% to 7% on my laptop).

    On my live page i have 3 tagfields with items in them and on a slower laptop my cpu usage jumps to over 50% and stays there. Making the page very unresponsive. This happens both locally and on live server.

    I have tried it on several different computers and with Ext.Net V3.21 and V3.3 and in Chrome and Firefox
    Last edited by Daniil; Sep 01, 2016 at 3:36 PM. Reason: [FIXED] [#1378] [4.2.0]
  2. #2
    Hi @Fergus!

    Can you try adding this JavaScript code to your page and tells us whether you get any performance improvement?

    This may turn some interaction in the tagField a little "less smooth", but may not help anything at all. This just adds a tar pit to the input change detecting algorythm not to be called everytime the browser can.

    <script>
        Ext.define("Ext.net.TagField", {
            override: "Ext.net.TagField",
            initComponent: function () {
                var me = this;
                me.grow = false;
                this.addCls("x-tagcombo");
                this.multiSelect = false;
    
                this.store = this.initTagsStore();
                me.callSuper(arguments);
    
                var task = new Ext.util.TaskRunner(50);
                task.start({
                    interval: 250,
                    run: this.checkInputElChange,
                    scope: this
                });
                this.pollTask = task;
    
                this.originalCollapse = this.collapse;
            }
        })
    </script>
    If this helps, you can try to balance smoothness by performance fiddling with the "interval" value on the override. It would be interesting to know from your actual production scenario -- if any improvement -- which value brought you best results. Maybe even a value of 1000 works well there.
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Hi Fabricio,
    Thanks for the info. I actually removed the below code totally and it improved dramatically. CPU usage down to under 1%.

    Not sure if i need that code. But i am only using tagfield for display purposes. No triggerfield. And it does not seem to affect the functionality.

    So you can mark this as closed.

    Thanks


    var task = new Ext.util.TaskRunner(50);
                task.start({
                    interval: 250,
                    run: this.checkInputElChange,
                    scope: this
                });
                this.pollTask = task;
  4. #4
    It would be interesting for us if you could, in your scenario, check the load readings for:
    - without the task code block (the solution you chose for you) - <1% load (informed in your last post)
    - with the code block - original - between 5% and 7% (informed on your first post)
    - with the value of 250 in that interval value
    - with the value of 50 in that interval value
    - with the value of 1000 in that interval value

    We would appreciate it if you could spend some time to provide us feedback on your test scenario!
    Fabrício Murta
    Developer & Support Expert
  5. #5
    Yeah, that is an overhead to constantly poll a TagField's input element. It should be only polled when it is focused and polling should be stopped one it loses focus. As well, I think 50 ms interval is okay combing with this change.

    Created a GitHub issue:
    https://github.com/extnet/Ext.NET/issues/1378

    Fixed in v3 and v4 sources. As for v3, the fix will be included into the next public release if any. As for v4, the fix will go to the 4.2.0 release.

    Thank you for the report!

Similar Threads

  1. [CLOSED] TagField MaxHeight
    By pgodwin in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Jun 30, 2015, 1:54 PM
  2. [CLOSED] TagField's HideSelected
    By RCN in forum 3.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 25, 2015, 10:37 PM
  3. [CLOSED] TagField problem in SVN revision: 6250
    By matt in forum 3.x Legacy Premium Help
    Replies: 5
    Last Post: Jan 30, 2015, 7:14 AM
  4. [CLOSED] TagField : How to allow duplicate Tag in TagField
    By matrixwebtech in forum 2.x Legacy Premium Help
    Replies: 13
    Last Post: Dec 31, 2014, 1:51 PM
  5. Store not working with TagField
    By GKG4 in forum 2.x Help
    Replies: 5
    Last Post: Feb 13, 2014, 5:20 AM

Tags for this Thread

Posting Permissions