-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Testbed: 16 bit memory layout for buffer #1855
Conversation
~0.43ms/frame -> ~0.37ms/frame
The results above are much more promising now regarding the runtime compared to the same test run in the 32 bit version #1854 (comment). Saved memory is ~ 0.5 MB. Note that my test call only created max 5 attr sets for all rows, thus So things to address in further tests:
|
Results in xterm-benchmark:
|
The attr storage is still flawed as it will hog memory over time for many ongoing cell changes which might even survive a buffer roundtrip due to the recycling 😊. No way around the ref counting I guess. Also with js array the attr storage is already at 200 bytes for just 2 one single number entries (due to preallocing empty slots), while the line content typed array for 87 cols is just 532 bytes per line. Much room for improvements still. |
Are they packed something like 24 bg, 24 fg, 5 remaining attributes? The fact that |
@Tyriar Currently the attr storage does not deal yet with RGB values, it just stores and compares the single attr number we currently use. With true color support the storage will have to match against 2 numbers. Imho its not possible to squeeze them into one number (we need around 58 bits, but a number can only store 53 exact bits). |
Closing for now and marking as reference as we might want to address this in the future again. Lessons learned from the 16bit vs. 32 bit version:
Currently the 32 bit version wins due to being faster and much easier to implement with true color in mind. |
Counterpart to #1854 but with UTF16 codepoint and attr indirection.
Implements:
Buffer layout:
Other than in the test described in #791 (comment) I changed the following things here:
cell
indexOf
instead of a RB treeThe changes show much better runtime behavior than the old test, its still slower than the 32 bit version. Memory usage is the same as in the old test. The attr storage can be further optimized by using another typed array.
More detailed test results will follow.
/cc @Tyriar, @mofux, @bgw