Skip to content
This repository has been archived by the owner on Sep 14, 2020. It is now read-only.

Javascript performance issue in Chrome #24

Closed
aligentjim opened this issue Apr 24, 2013 · 5 comments
Closed

Javascript performance issue in Chrome #24

aligentjim opened this issue Apr 24, 2013 · 5 comments
Assignees
Labels

Comments

@aligentjim
Copy link

I've not been able to completely isolate this issues, but... An issue occurs when the Enhanced Admin Grids extension is installed, and I have added one or more tabs to the Product Edit page which contain grids via another extension.

Upon product save, Chrome uses a lot of CPU and takes a very long time (45 seconds to 1 minute) to validate the form before the first Ajax request occurs.

My product edit page has three new tabs with a grid on each. If I comment out two of the tabs in layout XML, the delay is reduced. If I comment out all three tabs (removing all of the extra grids) the delay goes away. If I leave all three grids enabled and disable the Enhanced Admin Grids extension the delay is also eliminated. Finally, adding the three grids to the exclusions list in System > Configuration also eliminates the delay.

This is a client side, js issue, the chrome profiler shows that a lot of CPU time is spent in validation related functions. I haven;t been able to determine where/what/why this occurs. I'm happy to try and produce a cutdown extension to aid in reproducing this error if required.

@mage-eag
Copy link
Collaborator

As there is no delay when just using the core (as far as I know / have tested), it would depend on whether the extension you use is rather common or not, and if enabling the extension on the corresponding grids has an actual added value. Otherwise, it would be simpler to just turn off their rewrites (and in the case of a common extension, maybe add them by default to the exceptions list).

@aligentjim
Copy link
Author

The extension in question is custom code that was written for the client. It adds three more grids to the product edit form, much like cross sells or upsells. The extension looks like a fairly standard admin grid implementation, nothing out of the ordinary. As the custom code provides significant business value for the customer, disabling it isn't an option. Adding those three grids to the exclusions list for CustomGrid makes the problem go away, but does not resolve the underlying issue.

I am happy to try and extract the minimal amount of custom code from this client's site to reproduce the issue if that helps.

@mage-eag
Copy link
Collaborator

When I was talking about turning off the rewrites, I meant to disable the corresponding custom grids (in System > Custom Grids > List), sorry for the misunderstanding :)

And concerning a minimal piece of code allowing to reproduce the issue, if you can extract it then yes it would be really welcome, as that may finally furthermore allow to find a potentially more general problem. Thanks !

@paales
Copy link

paales commented Oct 3, 2013

I've noticed performance problems with grids in combination with the adminhtml/widget_grid_serialize block, if on-ajax not only the grid is reloaded but the serialize block is loaded again it causes performance problems in javascript.

Example XML

    <adminhtml_inventoryupdates_product>
        <block type="core/text_list" name="root" output="toHtml">
            <block type="ho_inventoryupdates/adminhtml_inventoryupdates_edit_tab_product" name="ho_inventoryupdates_edit_tab_product" />
            <block type="adminhtml/widget_grid_serializer" name="product_grid_seralizer">
                <reference name="product_grid_seralizer">
                    <action method="initSerializerBlock">
                        <grid_block_name>ho_inventoryupdates_edit_tab_product</grid_block_name>
                        <data_callback>getSelectedProducts</data_callback>
                        <hidden_input_name>links[qtys]</hidden_input_name>
                        <reload_param_name>products</reload_param_name>
                    </action>
                </reference>
            </block>
        </block>
    </adminhtml_inventoryupdates_product>

    <adminhtml_inventoryupdates_productgridonly>
        <block type="core/text_list" name="root">
            <block type="ho_inventoryupdates/adminhtml_inventoryupdates_edit_tab_product" name="ho_inventoryupdates_edit_tab_product" />
        </block>
    </adminhtml_inventoryupdates_productgridonly>

Not sure if it is related, but though I'd share my experience. :)

@aligentjim
Copy link
Author

@paales great observation. That's exactly what's happening in our situation! Thanks for your assistance! 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants