-
Notifications
You must be signed in to change notification settings - Fork 12
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
Linear data structure. #65
Comments
I have pushed tests to the performance branch. A used the array of 40K elements, every character with 3 styles. This document is 10 times bigger then Apollo used for CKEditor 4 examples and equivalent to 15-20 pages of text (depends on standard). I used random character to avoid fake results because of browsers optimizations. Memory usageI measured memory usage on Chrome using build-in memory profiler. Memory usage:
On Firefox it is hard to measure memory usage. All I can do without rebuilding a browser is to measure how much memory tab is using, what seems to be good enough. Results on Firefox are very similar to those on Chrome. Performance testsI tested 4 operations: creating, adding attribute, removing attribute and checking type. CreatingIt is interesting that creating objects with long properties names ( Checking typeI tested 5 ways of checking if it is character data ( Adding and removing attributeAdding and removing attributes is about 10 times faster when attributes are stored as an object instead of data, it takes then 1-2 ms instead of 20 ms, if the attribute is already defined and we do not add/remove new property, but only change its value. So if I use |
Very interesting research, @pjasiun. I think that memory usage should not be an issue at this point. The most important is having a model that performs well in the most intensive tasks we need to perform: (1) startup creation and (2) runtime manipulation. If (1) is a matter of milliseconds difference, our focus must be on (2), because this will be the point that brings more impact in terms of UX - features must perform as fast as possible. So it looks like "array of objects with attributes as objects" seems the way to go. |
I definitely agree. The most important conclusion is that memory usage and performance are acceptable. And because changing attributes is the operation user will perform most often "array of objects with attributes as objects" seems to be the best data structure. |
The document prototype used for linear data array which contains strings (for characters without styles), arrays (for characters with styles) and objects (for opening and closing elements). This structure could be simplified to arrays of all types of characters or using objects everywhere, but the research is needed to check the performance of each structure.
The text was updated successfully, but these errors were encountered: