-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve performance #14
Comments
@ffont: >
-- I measured a lot during the last days.
I tried to try HTML-GL but failed here, too. It also seemed to not feature retina displays... Question - why don't we use the canvas from the beginning, if it is so fast? |
I managed to reduce load in the soundlist PR #46, as the whole table was re-rendering with each map move. Just used But for the spaces tab I didn't figure it out yet. Tried to set |
The We moved away from canvas because the interaction with canvas elements was rather limited (even though we never tried a library on top of HTML canvas). Also SVG seemed better because vector graphics bla bla bla. @giuband do you have any ideas what could we do here? Would it make sense to try some canvas-based visualization for the map? What would be the best approach to try something like that? (if it makes any sense at all). |
Migrating back to canvas would give the greatest positive impact on performance, as it's much more performant than SVGs when there are thousands of elements. But it would take quite a lot of time and probably some of the things will have to be hacked in order to work as they do now (like hovering or clicking on elements). Other things that can be tried without being that complicated and time demanding:
Honestly, I'd try with all of them and see how feasible they are. The third option is the easiest one and I'd start from that just to have some benefit in the short term. |
A search in Chrome with 300 resulting sounds results in a max 185 ms frame movement (5.5 fps!) when dragging the map. A short measure shows: I think we'd need to improve the whole thing about state changes. |
I like your ideas @giuband. To start we should try "randomly" hiding some objects when moving the map to see how performance is affected. To do it less randomly we could hide the objects which are far from the mouse pointer. Another idea, we could replace the whole map for a rasterized version of it when moving. I guess this is lot of work but I think this is how PDF viewers do it for example. |
Challenging isn't it? :) |
That’s the spirit! |
My first and quickest idea: |
Sounds like a good idea, although I guess the problem is that circles receive too many updates of x, y positions and using debouncing might stop drawing them until the end, but it will be an interesting idea. Another idea, could we “sample” the solution of the tsne at a lower sampling rate (eg, 250ms) and animate the circles from one position to another (interpolate)? |
If it is even possible with the React Library, it could dramatically improve animation performance to use the object pool design pattern for the Circle Objects. Currently we are re-instanciating each circle each frame of movement. Don’t know how to achieve this yet. Maybe with the use of the react lifecycle methods. |
Can't check this out properly at the moment, but keep in mind that using the |
Much can be done to improve overall performance, some ideas:
React.Perf
to identify other causes of unneeded renderingsreact-virtualized
on heavy tabs (like spaces one)The text was updated successfully, but these errors were encountered: