Skip to content

Use of toggle is expensive #79

@edwh

Description

@edwh

This is on v1.1.2. When you render a model view, you call toggle to make sure that it's shown/hidden correctly based on any filter. My profiling on Chrome suggests that this is a bit of a performance hog, and you only really need to do it if the filter has indicated that you should hide it. Putting an if speeds things up a bit.

            if (hideThisModelView) {
                if( thisModelViewWrapped.children().length === 1 )
                    thisModelViewWrapped.toggle( ! hideThisModelView );
                else modelView.$el.toggle( ! hideThisModelView );
            }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions