Making Instagram.com faster: Part 3 – cache first(instagram-engineering.com) |
Making Instagram.com faster: Part 3 – cache first(instagram-engineering.com) |
We’ve [1] been advocating strongly for using performance budgets [2] as a means of protecting hard-earned performance improvements. There’s some depressing stat around performance regressions... something like 25-50% of big sites regress in performance 6 months after a big push to optimize. Don’t quote me on the specific number, I believe it’s mentioned in [3].
[1]: Google Web DevRel
Every feature request is adding more logic to the code, and it's not uncommon for the business to ask for code that affects every single path.
I've noticed this before, but it's very true on this project: management is very hesitant to create new 'areas' of the application, and so more and more functionality shows up on the common paths through the code, with all of the attendant uptick in computational complexity that goes with it.
Long ago I had a job where they couldn't understand why the whole site had gotten slower. Well, apparently when we told them that putting an expensive call in the header on every view, that everything was going to get slower, they didn't believe us. Nobody needs that kind of data, the ones who do don't need it to be accurate to the millisecond, and every penny you spend on information the average user is unaffected by is wasted money.
There is no big picture. There is only hill climbing and getting stuck on local maxima constantly. And no I'm not bitter, why do you ask?
This really nicely describes why I think so much software becomes bloated. You see this with startups all the time--at first the product is hacky/clunky/lacking features, then after some time and love it does a small set of things really, really well and is truly a joy to use, and then later on it becomes slow, bloated, and trying to do far too much and ends up doing many things unremarkablely rather than a few things well (the opposite of "half, not half-assed").
I think that last stage happens when you have individual teams A/B testing new changes independently and hacking on each new piece without much thought to the overarching cohesiveness of the product. All the incentives naturally align toward this too, so it takes some really strong leadership to prevent it and have a broader product vision that supercedes all the local optima of each individual team's features.
(As a side note, this also often happens when the software/startup needs to be monetized)
If you're constantly ensuring that performance doesn't regress, this makes certain features a lot harder to implement. In some cases, the better solution is not to "make this feature take a lot less of the budget", but to say, "are there other parts of the budget that are easier to cut than the current feature".
Having regular performance optimization sprints allows for us to "cut where it's easiest" rather than forcing us to restrict non-performant features, when they might be very useful for the business.
Performance is improved by removing a layer of abstraction.
Lather, rinse, repeat.
Because the old system was indeed super annoying, seeing something cool and then having it disappear in a long feed was annoying beyond belief.
It's a small change with the hover button, but one that is definitely a huge improvement. Sometimes the biggest UX changes are super minor - but their impact on a user's experience is massive.
Maybe iOS only for now.
80% of my clicks are my palm grazing the edge as I hold it or trying to scroll and accidentally clicking on some block element link that doesn’t stand out as a button.
I vehemently HATE this pattern.
I'm on a slow connection, and I open the app.
Yay, I see some (cached) content. I start reading.
After a random amount of time EVERYTHING CHANGES, and I can't get back to it. It's gone, for all intents and purposes, forever.
I'd love to have a something which tells me there's fresh content to be had, and that I could - if and when I so wanted - CHOOSE to see it.
I'm less optimistic about the desktop version since the uselessness of it seems very much intentional but oh well.
Because the comments side panel on pictures is probably the buggiest implementation of _anything_ i've ever seen.
What's the point of making a website if it's crippled compared to the mobile app?
And, for that matter, permit hyperlinking in posts. It is the world wide web, not a strange aggregation of profile links.
does not make any sense!
i mean, i put up with it because i don't have an account and well they can decide not to show unregistered people anyone's feed.
The more elegant way to do optimistic UI would be to use CRDT or OT.
Usually syncing is talked about in the context of syncing multiple clients. Here, we just want to sync the cached offline state with the server state. This allows you to make arbitrary changes to your offline state even if your server has conflicting changes incoming, it will all be eventually consistent in the end.
I would love to see a blog post about that! (the only way I know how to implement it cleanly is using pouchdb)
Why can't search handle two keywords?
I firmly believe this should never, ever be done. This is the very reason I swapped to linux from windows xp many years ago: there was no way to tell the computer not to do anything unless I ask for it.
I have 1000+ connections on FB, built out over the past 15 years (I started using FB in college when it was a college network); which is to say, I'd never be able to fully read everything every one of my connections have posted because there are too many. Sometimes I see an interesting post as I'm scrolling, start reading it, and everything changes (sometimes it waits until I click into the comments of a post, and go back, and then everything changes, which is arguably worse because now I can't refer back to the original post...). If I didn't make a mental note of who created that post, it's lost forever. If I remember who posted it, at least I could search for that person, and scroll down on their feed.
I only have like 150 friends on FB and it's already hard to find something.
If its good enough to show, it's good enough for me to look at. If it's good enough to look at, don't fucking rip it from my eyes.
Do not touch the viewport after content has been loaded. Hydrated into the feed only below everything the user might currently be looking at.
It’s like Flash of Unstyled Content, but instead it’s Flash of Useless Content Killed.
Or something with a similarly appropriate acronym.
When you're signed in to your account, right click the page > inspect. Then when the right side inspect panel opens, make sure "device tool bar" is toggled to show up (it's an option in the very top right, left of Elements, Console, Sources, etc).
Set the device options to responsive, something like 500x700 or whatever works for you. You can drag the dimensions on width. Then reload the page. It should retain the device dimensions choice and will show the mobile nav bar at the bottom that includes an upload button.
I also see if it the app is running in the background and I switch back over to IG. I can be in the middle of my feed and scrolling and after a few seconds it refreshes and I lose my spot.
Great for the web team if they are doing a better job than the mobile team I guess.