You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TL;DR the problem is with storing cell event handlers in array, that gets virtually never cleaned up - even when actual cells are created/released fairly regularly.
So the issue is with Editor.js with code in _configureEditorColumn method's column.renderCell anonymous function containing code:
Here we can see, that cell's event handlers are stored in grid's "_editorColumnListeners". This array of handlers belongs to columns - and therefore is cleared only when "_editorStructureCleanup" method is called (as found out via project-wide search) - so basicly only when grid structure changes.
Now when we consider, that someone could view same grid for prolonged time (like with using pagination and browsing pages of grid => cells get created and discarded), then we can see, that the number of handlers attached on unused cells increases and memory consumption with it...
Correct solution would be to bind cell event listeners to some new array called like "_editorCellListeners", that would be created for each row in e.g. insertRow and cleanup upon call to e.g. "removeRow".
The only problem with this solution is finding correct row by cell - there is no direct referrence and looking up row by traversing DOM feels dirty/slow.
I am willing to create full solution to this problem, but I don't know all the details of API and the overall picture of the solution, so I might be missing some elegant feature/place that would make this fix cleaner (my very direct and possibly wrong approach would be to edit Grid.js "createRowCells" function for every cell to have direct link to it's row AND storing "_editorCellListeners" array of listeners directly on row HTML widget).
The text was updated successfully, but these errors were encountered:
TL;DR the problem is with storing cell event handlers in array, that gets virtually never cleaned up - even when actual cells are created/released fairly regularly.
So the issue is with Editor.js with code in _configureEditorColumn method's column.renderCell anonymous function containing code:
Here we can see, that cell's event handlers are stored in grid's "_editorColumnListeners". This array of handlers belongs to columns - and therefore is cleared only when "_editorStructureCleanup" method is called (as found out via project-wide search) - so basicly only when grid structure changes.
Now when we consider, that someone could view same grid for prolonged time (like with using pagination and browsing pages of grid => cells get created and discarded), then we can see, that the number of handlers attached on unused cells increases and memory consumption with it...
Correct solution would be to bind cell event listeners to some new array called like "_editorCellListeners", that would be created for each row in e.g. insertRow and cleanup upon call to e.g. "removeRow".
The only problem with this solution is finding correct row by cell - there is no direct referrence and looking up row by traversing DOM feels dirty/slow.
I am willing to create full solution to this problem, but I don't know all the details of API and the overall picture of the solution, so I might be missing some elegant feature/place that would make this fix cleaner (my very direct and possibly wrong approach would be to edit Grid.js "createRowCells" function for every cell to have direct link to it's row AND storing "_editorCellListeners" array of listeners directly on row HTML widget).
The text was updated successfully, but these errors were encountered: