It makes me smile every time I notice IGListKit at work in Instagram. We put a lot of work into making and improving it. Proud to see it holding up 4 years later.

🧵 with some memories on how it was built:

At Instagram, product work slowed around the holidays, so we used the time to pay down tech debt. In winter 2014 I reviewed a +12k line refactor from UITableView to UICollectionView.

We recently dropped iOS 5 so we could use the new 6+ APIs without backwards compatibility.
That review taught me a lot about UICV: data sources should mutate in one place else risk out-of-sync exceptions, the first view layout may reloadData, sticky headers make good perf hard, and many more UICV tidbits
We used reloadData for everything and it worked, for the most part.

Except two things bugged the hell out of me:

1. No animated changes (duh)
2. Images could flicker and the like animation could cancel
I dug into the latter and learned that if you reloadData, every cell on screen gets reused. So even if nothing in the UI changes, you still reuse (or init) cells, bind data, set images, etc. that’s a lot of work!
When you liked a post, we’d call reloadData. Since all cells are replaced: we had to track the liked row, reload, and THEN perform the like animation. 😓

If something triggered another reload after the animation started, the cell cancelled the animation (thus the UI bug)
The image flickering issue was simpler:

When an image cell is reused set the background to grey, async load the image (cache or network), set the image. The async time between reuse and fetch/set from cache is where the flicker came from.
(@ryanolsonk solved the image flicker with an insanely clever “weak image cache” design. It’s a great interview question 😉 )
This all got me thinking: what if we only updated cells when the data changes? This general idea was gaining traction (ahem, React): bind data to views, and diff the data on change to only rebind changed data+views.

Enter UICV performBatchUpdates
Using the principle of only updating the data source in one place, I could diff the from/to data and use UICVs APIs to insert/delete/reload/move. Anything unchanged wouldn’t get touched!

So how the hell do I write a diffing algorithm? I literally had never done this.
I researched several algos: rsync, Myers, react...

I settled on Paul Heckel’s https://t.co/jpxuHNlpXg

Why?

1. It’s output matched UICV’s APIs: inserts, deletes, updates, and moves
2. There were example implementations I could actually understand
A pivotal decision was how we define identity and equality. I wanted to piggy-back off NSObject’s -hash and -isEqual: methods to spare our engineers having to write/understand diffing concepts.
@ryanolsonk convinced me I was wrong bc writing proper -hash is complex https://t.co/4PgDCykAna

Foundation hashes can collide
https://t.co/h9eVHO342U

Or are too basic for diffing
https://t.co/Pp0eVFRS5e https://t.co/ZNPJnXlXa4
We settled on a hybrid API: a protocol with custom identifier and -isEqual: We later scrapped the NSObject tricks as they were easy to abuse & forget, resulting in crashes.
Fun fact: the library was originally called “IGStoryKit” but my director hated that so we renamed it. Glad we did, guess what launched 6 months later? 🤪
Over the next several months, @jesse_squires and I refactored probably 20k lines so that we could run our new infra alongside the old one. This let us safely A/B test performance before rolling out.
We started with single-item feeds but quickly moved to support the main feed. Main feed was scary (we were starting to run ads 😬) but if we could replace feed, then the rest of the app would fall in line.
@ocrickard and I spent a couple months investigating crashes and tuning performance. I learned a lot about ObjC++ during this time (unordered_map was waaaay faster than NSDictionary for our diffing).
We ended up filing 4 UICV radars from all this investigation! Some have been closed

https://t.co/BACvyI2l08+
When everything was fixed, we launched. I spent a year advocating the eng org help refactor and deprecate the old infra. It came down to the profile view. I rolled up my sleeves and did it myself. It was TOUGH

With profile done, I submitted a -12k change to remove the old infra.
From the start we wanted to open source the library. It ended up being a lot of paper work and internal politics, but we did it. Forever grateful to @jesse_squires for setting the project up for success and @mikeyk for having our back.
We started writing the library in late 2015, launched feed summer of 2016, and deleted the old infra in early 2017.

Throughout this the eng team 10x’d and users 4x’d, we launched tons of products (Stories!), IG opened a NY office, UICV got diffable data sources, and more.
After we launched 4y ago I calc’d our diffing algorithm executes over 40,000 times a second. I can’t imagine what that is now!
Building IGListKit was a career’s-worth of learning packed into a couple years.

I’m proud that it’s still powering Instagram today, but I’m looking forward to learning about what replaces it.

More from Social media

So let's check in on "Newsguard," one of the Orwellian groups (e.g., The Atlantic Council) that totally reliable sites like @voxdotcom and @axios use to decide what is "Unreliable" and "fight disinformation."

One example:

OK, so "The Daily Wire" and "
https://t.co/oEa89coNak" are unreliable. Fair enough, maybe they are (I don't use either one of them).

So let's look into one of our new official arbiters of "reliability," Newsguard!

What's their advisory board look like?

https://t.co/5N8op70VE1


OK, so maybe a few names jumped out at you immediately, like, oh I don't know, (Ret.) General Michael Hayden, former Director of the CIA AND former Director of the National Security Agency in the run-up to the Iraq War in 2003! Google him, he's famous!


Newsguard is all about "seeing who's behind each site," (like how Michael Hayden is behind Newsguard?)

All they want to do is fight "misinformation." That's laudable, right?

Also, Newsguard has a "24/7 rapid response SWAT TEAM!!"

So cool!
https://t.co/EDN3UXvBR9


Ok, I'm not a journalist or a former CIA director, so I have no idea what's true or not unless someone tells me, so hey, Columbia Journalism Review - what do you think of Newsguard Advisory Board Member Michael Hayden?
Great bit of journalism here by Sophia :) fun fact, we had some verrrrry interesting conversations about what exactly the Trump campaign might be doing on TikTok.

So let’s talk about that!


Super glad I could be of help btw :P

Anyhoo: my background = senior web dev, data analysis a specialty, worked in online marketing/advertising a while back

You’ve got this big TikTok account that’s ostensibly all volunteer, just promoting Trump’s app because they’re politically minded and all that.

Noooooope. They’re being paid.

Sophia says it’s just possible (journalist speak I assume) but I know exactly what I’m looking at and these guys, Conservative Hype House, are getting paid to drive traffic and app installs for Trump.

So how do you know that, Claire?

Welp, they’re using an ad tracking system that has codes assigned to specific affiliates or incoming marketing channels. These are always ALWAYS used to track metrics for which the affiliate is getting paid.
I wrote 30 Twitter threads in 30 days.

The goal?

Learn how to craft interesting threads, and grow a following. It (mostly) worked.

- New followers: +2.5K (+100% MoM)
- Top thread: 373K impressions
- Top tweet: 2.5K likes

Here's what I learned. Quick thread 👇👇

To start, here's the most popular thread I've written.

Thoughts on what made it work, below.


1. Quality

The threads that performed best were (usually) the ones I put the most effort into.

One example is this one about Jeff Bezos's origins. I spent hours researching and drafting it.

It's worth taking the time to craft your


2. Timeliness

Capitalizing on the news can be one way to expand viewership.

When Fornite launched its #FreeFortnite campaign, I wrote this thread.

At the time, it was my 2nd best performing thread. It also introduced me to the lovely


3. Narrative Arc

Have a clear start and end in your mind.

I made this mistake with a few Amazon threads. I thought because my first one worked, I could keep the story going. But they didn't have as clear a narrative arc and were much less popular.
As we wait for the transition of power from despot to democrat, Facebook (Zuckerberg) has taken it upon itself to aid in the obstruction of that power transfer, facilitation of an insurrection narrative and disregard for the will of the American electorate.


In other words, the Social Media monopoly Facebook commands globally has gone full fascist in an attempt to preserve the corrupt and criminal hold on power by Republicans and Trump Administration.

Aiding and abetting a coup d’état.

As if there weren’t enough other reasons to dismantle Facebook’s monopoly, Zuckerberg is playing his cards and revealing clearly that Cambridge Analytica election interference was not just a onetime anomaly, but is now a feature of Facebook’s business model.

Megalomaniac Marc has now revealed the true colours of Fascist Facebook.

Facebook is a weapon to manipulate the masses. A tool to carry out disinformation campaigns with impunity.

And the response of the left... is to delete their Facebook account.

As if the deletion of a Facebook account will do anything. It might send a message that your virtues are principled, your morality superior. But it enables the weapon to be continued to gaslight and manipulate the electorate.

An inherent flaw in the left’s critical thinking.

You May Also Like

Margatha Natarajar murthi - Uthirakosamangai temple near Ramanathapuram,TN
#ArudraDarisanam
Unique Natarajar made of emerlad is abt 6 feet tall.
It is always covered with sandal paste.Only on Thriuvadhirai Star in month Margazhi-Nataraja can be worshipped without sandal paste.


After removing the sandal paste,day long rituals & various abhishekam will be
https://t.co/e1Ye8DrNWb day Maragatha Nataraja sannandhi will be closed after anointing the murthi with fresh sandal paste.Maragatha Natarajar is covered with sandal paste throughout the year


as Emerald has scientific property of its molecules getting disturbed when exposed to light/water/sound.This is an ancient Shiva temple considered to be 3000 years old -believed to be where Bhagwan Shiva gave Veda gyaana to Parvati Devi.This temple has some stunning sculptures.