5 ms·
Maybe 4mb of memory required in the compilation step, the file mentioned in the article, "t1-more" is only 355kb over the wire.
by evilduck 14y ago
Maybe 4mb of memory required in the compilation step, the file mentioned in the article, "t1-more" is only 355kb over the wire.
- debacle 14y ago350kb of JS is still a ton of JS. I remember deploying YUI almost five years ago now, and 130kb was 'too much' JS.
- awj 14y agoThe main page for the site I work on makes extensive use of jquery, jquery ui, backbone, a crapton of custom javascript, and more of the OpenLayers library than most places I've seen. It weighs in at 330kb and has a decent bit of fat to trim. What on earth are the people at twitter doing that warrants that much code? Maybe their single page app -> dedicated page transition was more about disabling some things and rewiring urls with the plan of taking advantage of the dedicated setup later?
- notatoad 14y agomost of twitter is still on single page app. they announced the change back to dedicated pages, but only rolled it out to user pages so far, afaik.
- jlarocco 14y agoIt's been a long time since I looked at the Twitter API, but I remember some of their API responses being hilariously inefficient. I don't remember the specifics, but something like retrieving a user's tweets the JSON would include a user "object" with every tweet message. The response would be something like this: [{user: {name: 'jlarocco', userid: 1, /* 50 other attributes */}, message: 'my first tweet', id: 1, time: 123456}, {user: {name: 'jlarocco', userid: 1, /* 50 other attributes */}, message: 'my second tweet', id: 2, time: 123498}, /* similar thing 18 more times */] If the rest of their stuff is like that, a 4MB Javascript file doesn't surprise me at all.
- shock3naw 14y agoNow that Twitter is 'stable,' the API is being overhauled and they are moving away from being a single page application. You forget Twitter has been dealing with technical debt for years. The fact that Twitter still runs on Rails and serves as much traffic as it does is testament to what the engineers there have built.
- riffraff 14y agoI think recently they added some options to omit nested informations in apis. OTOH, duplicated data _is_ easier to handle and produce and probably on the wire efficiency wasn't a big concern in the original twitter app.
- vacri 14y agoIt reminds me back in the day of the 'to html' converter in Microsoft Word. If you had a table in the original document, the converter would needlessly specify all the typeface information in each individual cell...
- falcolas 14y ago> that "bundle/t1-more" file is a whopping 4 129 653 characters. I'd have to imagine that 355kb is the compressed size, but that character count (assuming one byte characters, not UTF8) works out to be 3.938 megabytes. That's a lot of code. Even more when you consider it's been minified.
- slig 14y agoDoes anyone have the numbers of Gmail JS size?
- bgarbiak 14y agoAccording to Firebug: roughly 250 KB is transferred, half of that is lazy loaded (after DOMready, I suppose) and it looks like the biggest file (75KB) is from Google+. All scripts uncompressed (not un-minimized) weigh about 740 KB.
- falcolas 14y agoMakes me wonder if it's the difference between a different language being compiled to minified Javascript vs. minified Javascript.
- n-gauge 14y ago~790k (min) in IE8
- evilduck 14y agoWhy do we have to imagine and then speculate from there? This is trivial to inspect. It's 1.34mb on disk uncompressed but still minified. The copy Twitter is hosting right now is 1409121 characters minified but uncompressed. I have to assume the 4mb mentioned is output from some middle step (closure compiler output?) I'm not arguing the merits of that filesize, just that it's definitely not 4mb.
- unfasten 14y agoI ran into this problem last night and ended up looking at the script. File size is 4,129,653 bytes, on a single line. I had it saved to check out what the problem was, so here it is if you want to check it out yourself: https://dl.dropbox.com/u/24903613/hn/twitter-4MB-line.js https://dl.dropbox.com/u/24903613/hn/twitter-4MB-line.js Link to it on Twitter's servers (I uploaded to dropbox just in case the file expires or is changed): http://a0.twimg.com/c/phoenix/en/bundle/t1-more.5d72926b785051d84927ae194c9a7bfd.js http://a0.twimg.com/c/phoenix/en/bundle/t1-more.5d72926b7850...