The PRPL Pattern
developers.google.com
developers.google.com
One adserving system I worked on had a very expensive correlation process where it joined auction stats with impression stats. Essentially a big Hadoop job, except run in a stream.
Another system I later worked on solved the problem by tying impression requests back to the same server that ran the auction. That server kept the auction data in memory until it either received the impression or until a set amount of time had passed.
Hearing how it worked made me feel a bit dirty, then I realized how much money it saved them to do it that way and I was impressed with the simplicity of it.
This site is fast, without PRPL.
That said, it is very vague. I think this presentation from Alex Russell does a much better job of demonstrating the need for progressive web apps:
Prerender, Push, Render, Pre-cache, Lazy-load
But of course Polymer doesn't do prerender, so it doesn't fit the Google's image.
It really bugs me that you'll have to load and parse a huge amount of code to get anything rendered on the screen with Polymer.
What developers often do is pull in a ton of components from the web components catalog and not realize that every component comes with a cost. It's no different than working with libraries. Know the tradeoffs.
There are plenty of examples of fast rendering apps that written with Polymer. Check out https://shop.polymer-project.org/ and https://www.chromestatus.com/features, to name two.
https://ebidel.github.io/polymer-experiments/polymersummit/f... is another example that shows how to utilize the "upgrade" feature [1] of the custom elements API. IOW, the browser can render markup without JS ever running. Unfortunately, this is not something that Polymer leverages very much. It requires more work and is less friendly to new developers.
[1]: https://developers.google.com/web/fundamentals/getting-start...
It's an older video though: https://youtu.be/g7f1Az5fxgU?t=6m42s
This reminded me of the "worse is better" essay, because it sounds very much like the perfectionist "MIT approach".
https://www.jwz.org/doc/worse-is-better.html
I personally prefer an emphasis on simplicity over perfection, especially when simplicity means you actually get working code. Is there any sample app around that obeys the PRPL pattern and is a good example to start from?
(And apparently a lot of other people want to see that picture, as right now I'm just waiting for imgur to do its thing.)
https://medium.com/@boopathi/flipkart-lite-the-how-f6eb311dc...
Gatsby at build time generates a static HTML version of each page. Which makes the initial load time of a Gatsby site super fast. The browser then loads the minimum Javascript necessary to make that page interactive. Then in a service worker, it starts prefetching Javascript and data necessary for other pages so that when you click on a link, it takes very little time to fetch the code/data and then make the page transition.
A couple sites running 1.0 code that you can check out are my blog https://www.bricolage.io/ and an example site cloned from Instagram https://gatsbygram.gatsbyjs.org/
I wrote up the performance plans for Gatsby in this issue [1].
One analogy I came up for that which I really like is to JIT or lean manufacturing.
Quoting myself:
"There's a close analogy to just-in-time manufacturing ideas. Companies found that the way to be the most responsive to customers is to actually avoid doing work ahead of time. When they did do work ahead of time this would paradoxically slow them down as the speculative work would get in the way of getting the work done that's actually necessary (resource contention).
For both manufacturing and web apps there's high inventory cost (unused code takes up memory) and a premium on responsiveness. The car customer wants their new car yesterday and the web app consumer wants their app running immediately. Any work you do ahead of time because "they might need it" gets in the way of the app being responsive to the user.
With both you want to wait until the user asks for something and then work overtime to get it to them as fast as possible."
[0] https://github.com/gatsbyjs/gatsby [1] https://github.com/gatsbyjs/gatsby/issues/431