DEV Community

Discussion on: Svelte: first impressions

Collapse
eostrom profile image
Erik Ostrom Author

Thanks for this. I agree, Svelte is unique, and from what I've seen it's great.

I believe your analysis of the DOM update algorithm. Of course, theoretically, depending on the application, it may not have a significant effect on overall performance. O(1) can be worse than O(n) if its constant factor is greater and n is always sufficiently small, and anyway, DOM updating is only one of many things going on in an application.

That's just an academic argument, though. The most persuasive factor for me is not specifically that Svelte has an O(1) update algorithm, or that it's compiled. It's that Rich Harris and the Svelte team take performance seriously, and it's evident throughout their work and in the way they discuss it. The algorithm and the compiler are results of that underlying attitude.

Collapse
munawwar profile image
Munawwar

"Of course, theoretically, depending on the application, it may not have a significant effect on overall performance."

Yes, like I said, if you are targeting low perf devices/embedded devices, it would matter.

But again... in some cases it's better to have perf as default rather than later realizing and spending significant effort on perf optimisation.
Some would be quick to call it "premature optimisation!".. it's not, if its free.

"That's just an academic argument...
It's that Rich Harris and the Svelte team take performance seriously.."

I think most of the frameworks take perf seriously. But not all of them are equal in the end. How would you know how much they achieve in perf, without, say, benchmarking.. or dissecting their work and reviewing it? 🙂

Thread Thread
eostrom profile image
Erik Ostrom Author

Fair enough.