3 ms·
I'd be very interested to see some proper analysis of the difference in speed between HTML/CSS vs just JS, it seems obvious to me that the former would be much
by Sean1708 9y ago
I'd be very interested to see some proper analysis of the difference in speed between HTML/CSS vs just JS, it seems obvious to me that the former would be much faster but then again I know how often "obvious" things are wrong.
- thinkxl 9y agothe list of sites on https://hnpwa.com/ https://hnpwa.com/ vs this https://news.ycombinator.com/ https://news.ycombinator.com/
- SquareWheel 9y agoWould you prefer that Hacker News reloaded the page every time you voted on a comment?
- thinkxl 9y agoI wouldn't mind. But it doesn't work that way, look: https://vimeo.com/58808364 https://vimeo.com/58808364
- SquareWheel 9y agoInteresting video, but it still seems to be a JS-driven technique?
- kccqzy 9y agoEven without JS, there are tricks to make the upvote button work without refreshing the page. HN used to do this, not sure if it still does.
- SquareWheel 9y agoDo you have a reference to any of those tricks? Sounds interesting.
- framp 9y agoYou could use a link with a background-image <style>.vote-42:active{ background-image: url(/api/vote/42) } </style> <a class="vote-42">Vote</a>
- SquareWheel 9y agoI ran a quick test. That actually seems to work, at least in Chrome. Very cool! https://codepen.io/anon/pen/weMwRz https://codepen.io/anon/pen/weMwRz Realistically, I'd probably never use it because it's so dependent on browser behavior, but still a cool alternative.
- SquareWheel 9y agoAs a very general answer, JS webapps will typically be slower on the first load because they require an extra step to show the content. Subsequently loaded-pages or resources can be significantly faster in webapps however, as they can request (or generate) exactly what they need. The problem of slow initial loads is being addressed by tools like React by offering server-generated pages on the first load, and then transitioning to JS-based loading for subsequent loads. This offers the best of both worlds.