3 ms·
It's not magic by VSCode, other web-based editing components such as the ACE editor are also lightning fast. There are two main reasons: - VSCode is rendering
by ralfn 9y ago
It's not magic by VSCode, other web-based editing components such as the ACE editor are also lightning fast. There are two main reasons:
- VSCode is rendering in the DOM what you see, not what you scroll to.
- VSCode is using the correct datastructures, so an insert of a line at the top, doesn't require updating/relayouting all lines below it, but more likely something like log(n) lines.
And these two reasons you can summarize as the difference between old skool engineers with proper training in datastructures, cache behavior and algorithmic complexity -vs- new skool "full-stack developers" that rely on a billion lines of code they haven't written (or understand) and who mainly script a bit in between. The (wrong) assumption in the recent decade was we don't need to train engineers to understand the algorithmic complexity of their code because 'computers will continue to become faster'. That was never true and never will be true, because an exponentially slow algorithm simply won't ever be fast enough regardless of the amount of transistors. And making something like a simple text editor (without syntax highlighting and all of that -- just being able to edit the code), is actually an easy test to distinguish between the two wildly different skillsets.