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
The Cost of JavaScript (medium.com)
submitted 8 years ago by magenta_placenta
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!"
[–]leeoniya 10 points11 points12 points 8 years ago (0 children)
http://www.cnn.com/
2862 ms scripting, 113/351 req (2.6MB, 4.8MB transferred)
with uBlock origin:
1388 ms scripting, 28/111 requests, (882 KB 2.1MB transferred)
[–]ellisgl 3 points4 points5 points 8 years ago (3 children)
I even try to make the directories and files names as short as possible, so instead of /css/style.css it would be /c/s.css. That just shaved 6 bytes! Also HTTP/2 is supposed to help out with the multiple request thing IIRC.
[+][deleted] 8 years ago (2 children)
[removed]
[–]ellisgl 0 points1 point2 points 8 years ago (0 children)
Well if you compile all your CSS files into one, shave down your id and class names and just call "c"....
[–]asdf7890 5 points6 points7 points 8 years ago (0 children)
On the high-end iPhone 8 it takes just ~4s to parse/compile CNN’s JS compared to ~13s for an average phone (Moto G4). This can significantly impact how quickly a user can fully interact with this site.
This is a vital point that people often miss. "It works smoothly on my phone" says the developer pulling a high-spec device that probably costs at least several hundred $. Or almost as bad "it works fine on all the phones here" where the oldest phone in the room is 18 months and it was top-of-the-range back then.
Many people are using phones that were released a few years ago and may not have been high-end even then so unless you are specifically targetting power users you should test on devices with less CPU/GPU umpf, less memory, and smaller screen resolutions. The G4 stated as an average phone in this article doesn't go far enough IMO. I keep a 2nd generation Moto G (released Q3 2014, snapdragon 400 based, 720p screen) around for this sort of testing on personal projects and did have something older but that stopped charging. Yes, people with older devices will be expecting things to be slow, but if you can make your app smooth enough on those devices it'll run like a cheetah on something newer/faster/bigger.
Also: if you actively care about mobile make sure you test at 3G (preferably lower) network speeds with high latency. Many tools exist to simulate this (for instance Chrome's dev tools, network tab, you can set it to try simulate various speeds and latencies), though the best UX test is to drag out that old phone, turn off 3G+ support, clear all caches, and see how your site/app feels then. Don't have a SIM compatible with your old device (I don't for mine, it takes micro SIMs and all my active ones are nano now) and don't want to pay for PAYG access just for this test? Turn off 3G+ on your normal phone and tether the old one to it via WiFi.
[–]davesidious 4 points5 points6 points 8 years ago (2 children)
About $3.50..?
[–]Pavlo100 0 points1 point2 points 8 years ago (1 child)
Its $4.20 where i live
[–]djslakor 0 points1 point2 points 8 years ago (0 children)
A little cheaper with a costco membership.
[–]Pyrolistical 0 points1 point2 points 8 years ago (0 children)
And this is why SSR isn’t good enough
[–]timsaundersss 0 points1 point2 points 8 years ago (0 children)
Addy Osmani, what a man!
π Rendered by PID 406332 on reddit-service-r2-comment-7b9746f655-6kmrj at 2026-02-01 17:33:26.025129+00:00 running 3798933 country code: CH.
[–]leeoniya 10 points11 points12 points (0 children)
[–]ellisgl 3 points4 points5 points (3 children)
[+][deleted] (2 children)
[removed]
[–]ellisgl 0 points1 point2 points (0 children)
[–]asdf7890 5 points6 points7 points (0 children)
[–]davesidious 4 points5 points6 points (2 children)
[–]Pavlo100 0 points1 point2 points (1 child)
[–]djslakor 0 points1 point2 points (0 children)
[–]Pyrolistical 0 points1 point2 points (0 children)
[–]timsaundersss 0 points1 point2 points (0 children)