-
Notifications
You must be signed in to change notification settings - Fork 0
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
Move to array-based instead of linked list, simplify, add tests #1
Move to array-based instead of linked list, simplify, add tests #1
Conversation
A higher-level note about using arrays is xtermjs#1853 (comment) . The Instead of:
I usually use the following idiom:
|
I don't think memory is an issue here since in the end this will just result in like < 100 more pointers. @jerch comments on perf? I think it's basically
Good point, will fix this up.
I changed this intentionally, I don't think we use that style anywhere else 😄 |
"I don't think memory is an issue here since in the end this will just result in like < 100 more pointers." It's on the order 100 more array objects (typically single-element), which is a lot more than 100 pointers. Still minor. |
@PerBothner, @Tyriar: My benchmarks show ~ 7% decrease for CSI commands (~ 2.5 MB/s slower in throughput measuring). Imho this is neglectible taking into account that the input stream hardly contains more than 10% CSI commands (only drawing intensive programs like curses based will send tons of them, but those operate most of the time on alt buffer with partial viewport updates and dont depend that much on total throughput). So I think we are good to go with the easier to maintain array based approach. 👍 Edit: To keep things halfway in one place I will wait with the code review for the PR against xterm.js. |
xtermjs#1853