4 ms·
"There is a huge opportunity here to contribute to Atom and make it way better than it already is. Write a piece chain text buffer implementation. Write a gap b
by lpasselin 10y ago
"There is a huge opportunity here to contribute to Atom and make it way better than it already is. Write a piece chain text buffer implementation. Write a gap buffer implementation. Anything but using a regular array like this."
Is it really that easy? Why aren't they using those data structures already?
- rawnlq 10y agoBecause it doesn't matter with modern day CPUs with typical file sizes and typing speeds. Worst case scenario for a plain array is if you insert to the front of the array where it has to shift everything down one. But even if the file is on the order of several megabytes, this will still finish in milliseconds at most and the typist won't notice it.
- time4tea 10y agoWhat a waste of fossil fuel energy! What a waste of laptop battery! It can be really hard to make software efficient, sometimes there are easy wins.. seems odd to not just do it. An insert or delete from (e.g.) a rope is very cheap and as they are immutable can make some other features very easy... saves copying megabytes...
- saosebastiao 10y agoI'd imagine that only having a partial buffer available makes it really hard to do text highlighting, auto completion, linting, etc.