-
Notifications
You must be signed in to change notification settings - Fork 8
Description
After completing #87 we were testing out performance in the browser and noticed that while file loading is fairly fast, fresh renders were still a 2-4 second delay. It's also fairly common to get "waiting for unresponsive page" warnings from Chrome using the 200 individual SARS-CoV-2 dataset. I think the MatrixCells are slowing the browser down.
Here's some napkin math:
- Matrix Cells (squished down) are 5x2 pixels
- Screen is 1920 x 1280
- (1920 / 5) * (1280 / 2) = 245,760 MatrixCell objects to create, render and track mouse movements
While React elements are more responsive than HTML elements, which cap out around 5,000 - 10,000, having 40 times that number of elements is surely a problem. ((More testing needed?))
The Solution
One ComponentRect can do the mouse tracking and mouse over text for all cells inside it. With sparse format, we may need a second lookup table, but it is doable. Instead of having MatrixCell elements, the ComponentRect has a single pixel canvas texture that can be painted on with the appropriate coordinates an colors. All the color logic of MatrixCell would move to this canvas. Link Columns would remain unaltered.
Drawbacks
This is a fair amount of development to get the last bit of scalability for screen saturation. It could be argued that row filtering, or picking unique examples in the current screen is more meaningful than cramming as much content onto the screen as possible. Filtering and representation features would be useful development in their own right, apart from performance.