Skip to content

Huge performance issues! #148

@baptistebriel

Description

@baptistebriel

Hello,

I've been working with tether and tether-select, and decided to made a quick performance test using Chrome's timeline tab..

Looks like there's a lot of painful operations going on; I made a test with ~ 20 custom <select> within the page, and every frames takes ~ 65ms to render. This is way too huge!

Every frame should be ~ 16ms.

screen shot 2016-01-20 at 14 32 02

We can see here that for every <select> element on the page, the functions are being called:

  • position
  • cache
  • getScrollBarSize

Theses functions cost a lot because of;

position (line 1003):
if (document.body.scrollHeight > window.innerHeight) {
getScrollBarSize (line 172):
var widthScroll = inner.offsetWidth;

screen shot 2016-01-20 at 14 41 11

screen shot 2016-01-20 at 14 41 28

Kinda related to this issue from tether-select: HubSpot/select#43

I really think this has to be fixed. Just to be sure, I do not have any other onscrollevents; everything on the screenshots come from tether.js.

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