Skip to content
This repository was archived by the owner on Jul 29, 2019. It is now read-only.

Timeline: Performance on first render is extremely slow #3276

Open
levzem opened this issue Jul 20, 2017 · 10 comments
Open

Timeline: Performance on first render is extremely slow #3276

levzem opened this issue Jul 20, 2017 · 10 comments
Assignees

Comments

@levzem
Copy link

levzem commented Jul 20, 2017

Hi,

I am working with timeline (4.20) in chrome 59 on windows 7. I am working locally though, and not on an actual website.

I am working with extremely large datasets and large amounts of groups (~40 groups with an additional nested group for each and 30K - 80K items).

It is my understanding that the timeline only loads the visible items to enhance performance. I set limits on the start and end date as well as the max zoom level. I am happy with the scrolling/moving performance, however, when I first load the timeline. it takes an extremely long time to actually first generate the timeline (5 minutes for 30K items, 15+ minutes for 80K items) even when the visible items on the timeline are incredibly low (4 items).

Your examples load quite quickly for 100K items (~10 seconds) and a simple JSBin program from #3248 does it in about ~20 seconds. Attached for reference -> https://jsbin.com/jupelipala/edit?html,js,output

Is there something I can do to improve my own performance or is this an issue that the timeline initially loads all items regardless of visibility?

Thanks

@bradh
Copy link
Contributor

bradh commented Jul 21, 2017

I'm not sure I understand the difference between your case and the performance test examples. Can you try to explain that a bit more?

@levzem
Copy link
Author

levzem commented Jul 21, 2017

The problem is that the initial loading/generation of the timeline is slow (performance after the fact is satisfactory).

If I run the same exact code from JS Bin locally from my machine, it takes an extraordinary amount of time, but on JS Bin, it runs pretty quickly. If I run the example code from the visjs.org locally even with many groups (40), it is pretty quick. Likewise, my code renders the timeline slowly as well. I am not sure where this difference comes from.

@bradh
Copy link
Contributor

bradh commented Jul 21, 2017

So its really only slow on your machine? That is going to be quite hard for us to debug. Anything unique that you can suggest might be related?

@mojoaxel
Copy link
Member

I can confirm this as a "problem". See also #3248

@mojoaxel mojoaxel added Problem and removed Question labels Jul 22, 2017
@levzem
Copy link
Author

levzem commented Jul 27, 2017

When do you approximately think that you will be able to resolve this issue?
Is there any fix that I can do in the meantime?

Thanks

@levzem
Copy link
Author

levzem commented Aug 3, 2017

It appears that providing a reasonable start and end time in the options resolves all issues for anyone with the same problem. It can be marked as not a problem as along as this is strictly document that start and end are necessary for performance.

@mojoaxel
Copy link
Member

mojoaxel commented Aug 4, 2017

I can confirm that setting a start and end improves performance very much.
We should have a look at this fixing #3248 !

We also should add a hint to the docs, that a missing start/end date can reduce performance.

@yotamberk
Copy link
Contributor

Will be added to docs

@abrander
Copy link

abrander commented Sep 6, 2017

In a project struggling with slow timeline performancewe did the following trick. Maybe it can help you too, @levzem

gansoi/gansoi@db825cb

@wimrijnders
Copy link
Contributor

@yotamberk Does #3475 fix this? If so, can you put a 'fixes' tag into that PR?

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

No branches or pull requests

6 participants