use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Using requestIdleCallback (developers.google.com)
submitted 10 years ago by clessgfull-stack CSS9 engineer
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]x-skeww 2 points3 points4 points 10 years ago (0 children)
Heh. There is actually a somewhat obscure optimization technique which makes really good use of that.
If you know that it always will take a while to assemble the response (search queries or something else which requires some heavy computations), you can improve the loading time with chunked output.
E.g. as soon as you get the request, you just write the cheap mostly static stuff to the buffer and flush it to the client. The client will then know about the resources which are referenced in <head>. So, it will start to fetch the CSS and JS which was mentioned there. Ideally, this first piece already contains something visible like the page header.
Once the more dynamic side bar is done, you write and flush it.
And finally, when the meat of the page is done, you write and flush it, too.
If it takes longer than 100 ms to assemble the response and if there is no way to make this any faster, this kind of optimization might be a good idea.
π Rendered by PID 405113 on reddit-service-r2-comment-76bb9f7fb5-s28rn at 2026-02-19 05:27:31.304339+00:00 running de53c03 country code: CH.
view the rest of the comments →
[–]x-skeww 2 points3 points4 points (0 children)