3 ms·
What the... Is that a function with a 560000+ lines long comment inside of it, that gets turned into a string, then sliced, and split on newlines, then assigne
by Xevi 6y ago
What the...
Is that a function with a 560000+ lines long comment inside of it, that gets turned into a string, then sliced, and split on newlines, then assigned to a global variable that gets used in another global function?
It took a minute just to open the source code in my browser. Chrome used 5.2GB of RAM while viewing the source code, just for that tab.
- umvi 6y agoYeah! Just goes to show you can make a cool thing that is really quick and dirty under the hood. You could make this page load instantly by making the random selection happen in the backend instead of in the browser, but then I guess it would no longer just be a static file. You could also just have a compact array of pairs and then generate the sentences in the browser instead of having half a million pre-generated strings.
- deleted 6y ago[deleted]
- Gene_Parmesan 6y agoThis is one of those things I would have just assumed was impossible, so never would have tried. Not that I should try something like this, mind, but it is a good reminder not to underestimate these machines we have.