Skip to content
This repository has been archived by the owner on Nov 19, 2019. It is now read-only.

Bad perfomance after upgrading from vis 4.17 to timeline-plus #81

Closed
jussila opened this issue Dec 10, 2018 · 5 comments
Closed

Bad perfomance after upgrading from vis 4.17 to timeline-plus #81

jussila opened this issue Dec 10, 2018 · 5 comments
Labels
bug Something isn't working perf improvment

Comments

@jussila
Copy link

jussila commented Dec 10, 2018

Hi,
After upgrading from vis.js version 4.17 to timeline-plus we got really bad perfomance. We have about 450 groups and 3000 items in them. I started to investigate what had changed and managed to pin it down to that something had changed between vis 4.17 and 4.18. So after a diff of these two versions i noticed that the following code had been removed from updateItemsInRange in Group.js

      if (!this.isVisible && this.groupId != "__background__") {
        for (var i = 0; i < oldVisibleItems.length; i++) {
          var item = oldVisibleItems[i];
          if (item.displayed) item.hide();
        }
        return visibleItems;
      }

If i put this code back the perfomance is back to normal but im not sure that this does not affect something else.

I also noticed that without the code we get alot of style recalculations and layouts.

Would it be possible to put this code back in timeline-plus or does this affect something else?

@yotamberk
Copy link
Owner

Can you tell me where exactly was this snippet? in what function in which row?

@yotamberk yotamberk added bug Something isn't working perf improvment labels Dec 15, 2018
@jussila
Copy link
Author

jussila commented Dec 15, 2018

The snippet should be put at line 814 in Group.js.
In vis.js 4.17 it was at line 505 in Group.js

yotamberk added a commit that referenced this issue Dec 15, 2018
@yotamberk yotamberk mentioned this issue Dec 15, 2018
yotamberk added a commit that referenced this issue Dec 15, 2018
@yotamberk
Copy link
Owner

Checkout v2.2.4
I've fixed the issue by returning the piece of code that was erased.
It was erased originally for an issue with a previous version of visjs and was later fixed differently in timeline-plus.

@jussila
Copy link
Author

jussila commented Dec 15, 2018

Ok, thanks. Will try it out and get back to you.

@jussila
Copy link
Author

jussila commented Dec 15, 2018

Works perfectly! thanks for the help!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working perf improvment
Projects
None yet
Development

No branches or pull requests

2 participants