

How Google makes Google(+) fast - jvandenbroeck
https://plus.google.com/u/0/115060278409766341143/posts/ViaVbBMpSVG

======
georgemcbay
Google+ is certainly fast, I just wish it were quicker about showing me
valid/updated state.

I've never used any website where the data I was seeing was so obviously out
of date across the board as it is on Google+. Yes, eventually it coalesces
towards correctness, but I don't think this model works well for things like
notifications and such.

"Oh look I have a new notification... oh wait, no I don't, that's from like an
hour ago and I already looked at it."

Speed _is_ a feature, but so is not making your users think your software is
just plain buggy and too much local state caching is basically
indistinguishable from a bug for many users.. and in many contexts it can also
be annoying even for those who know roughly why it is happening.

~~~
shantanubala
Facebook is pretty amazing in that respect. They managed to engineer a
scaleable infrastructure _without_ making it too obvious that everything is
being cached. There are times when it takes a minute or two for my profile
picture to change everywhere after I change it in my profile, but aside from
minute-or-two scenarios, Facebook's interface (and the real-time notification
system) is just amazing in comparison.

~~~
vl
Facebook runs largest memcached cluster in the world and largest sharded MySQL
installation in the world (which they use as a key-value store since it's hard
to evolve schema otherwise). So, essentially, quick updates are tremendous
amount of duct tape and hand-crafted code to make it work more or less
correctly.

~~~
bad_user
I've always wondered why alternative datastores, like MongoDB, get so much
good press when a RDBMS like MySQL or PostgreSQL can be used for storing non-
relational data in a way that scales tremendously.

The only article I'm seeing for this issue is this one from 2009, by Bret
Taylor: <http://bret.appspot.com/entry/how-friendfeed-uses-mysql>

Other than that, crickets, which is a shame as these RDBMS databases are
proven to be more reliable than the fad du-jour.

~~~
Fizzer
There's a video (I don't have the link handy) where a Facebook engineer says
they actually had to make code modifications to MySQL to make it do what they
want.

They're using the tool in a way that it wasn't designed to be used. Therefore
it's probable that that there's an opportunity for specialized software to
fill the role better.

------
coderdude
"On a side note, you may have noticed that we load our CSS via a XHR instead
of a style tag - that is not for optimization reasons, that’s because we hit
Internet Explorer’s max CSS selector limit per stylesheet!"

Can anyone go into more detail about what they're talking about here? I didn't
realize IE had a "CSS selector limit." Seems like a funny thing to mention
when you're talking about how optimized your site is.

~~~
gvido
Yes, the magic number is 4095 selectors. And it's still true, even in IE9.

~~~
youngtaff
Do they really need that many selectors - it can't be good for performance?

------
MrEnigma
The little red box that shows how many notifications, is anything but fast...

Edit: It reminds me of the eBay motors data we got a few weeks ago. A lot of
it is making the page appear to be loading (i.e. flush the buffer for 'above
the fold' and then ajax everything else in)

~~~
agumonkey
That little box was one of the delights of previous social websites i've toyed
with, G+ flipped it into an anguish box.. amazing.

------
dmix
Are people outside of Google using closure to develop apps?

I used the closure compiler with Jammit but I've never tried the library.

~~~
aidenn0
clojure-script uses closure as part of compiling clojure to js. I'm not sure
if any significant projects are using it though:

<https://github.com/clojure/clojurescript>

~~~
cosgroveb
Google Closure Tools is not the same thing as Clojure.

A little confusing I am sure since Closure Templates is a templating system
that dynamically generates HTML in Java and JavaScript... And Clojure is a
language that targets the JVM.

I have no experience with Closure Tools but Clojure is awesome definitely.

~~~
piranha
ClojureScript uses Closure Tools:
<https://github.com/clojure/clojurescript/wiki/Google-Closure>

~~~
cosgroveb
Either the author of the comment I replied to ninja edited his comment or I
need to work on my reading comprehension. I think it was the first thing
though...

------
georgecalm
Does anyone know why they've chosen to use the iFrame approach to loading JS,
instead of attaching script tags dynamically, a la RequireJS?

------
archangel_one
I'm rather more grateful for all the work Google have done here after using
Diaspora; the one thing that nags me about that more than anything is how much
slower than G+ or Facebook it is. A couple of seconds on each click really
breaks the whole experience.

------
acdha
There's a major downside to all of this complexity, however, because it
degrades really poorly: I routinely see 30+ second page loads in Google Plus
because they load a ton of code and you won't see anything until it completes
80-130 requests (warm/cold cache respectively) to load almost 5MB of
resources! An ugly, non-interactive 1994-style simple HTML page would be far
more useful to me at such times…

In practice, this happens to me multiple times a day on a normal connection
and more frequently on congested or hotel crappy WiFi.

------
jongraehl
Is this also why the new Google Reader is so slow (they're using a more
general framework that doesn't match the old Reader's performance when rapidly
paging through article previews)?

------
rkon
Cliff notes: By not having any users.

