3 ms·
> write a program that is able to load and execute a 2021 website But I thought it was supposed to be "decent and snappy"? This requirement seems to ruin it qu
by jhgb 5y ago
> write a program that is able to load and execute a 2021 website
But I thought it was supposed to be "decent and snappy"? This requirement seems to ruin it quite a bit since 80% or so of your snappiness goes away.
- jcelerier 5y agoit seems that we are entirely talking past each other. I am talking about implementing a web browser. Writing a program that can load www.example.com and displays it, in at most a few milliseconds. Of course loading a bloated website will be bloated but that's because websites use a turing-complete language - if my web page has <script>while(true);</script> of course things won't go fast, but it doesn't matter, what matters is that we write an engine that is able to execute that "while(true)" and burns those CPU cycles as fast as possible (because then a "normal" website won't be much slower than the theoretical best it can do). It's a (semi)well-defined problem: how fast can you do network requests, how fast can you parse the DOM, can you fetch content such as images concurrently, how fast can you execute JS, which is all benchmarkable. It does not matter than it's going to be slow when loading www.facebook.com ; what matters is that it isn't slower than it should be. That's like writing a generic sort function: you care about the performance of the sort algorithm ; of course if people use a sorting predicate which does filesystem access for them it won't be fast but it is also utterly irrelevant to measuring how fast your sort is.