On Rendering Diffs

30 points by jado a day ago on lobsters | 5 comments

[OP] jado | a day ago

Eternally frustrating that Microsoft seems incapable of allocating performance engineers to work on The Most Important Part of GitHub (the code view). I’m not sure what happened to the main pierre.co site, looks like they shut it down, but I hope this tech can be integrated into a larger code hosting platform.

kornel | a day ago

It's mind boggling that Github hides "large" diffs. This is dangerous as it makes it easier to sneak in unseen code changes in PRs. Github's threshold for a "large" diff change isn't even large. Browsers can easily render static HTML 10× larger than that.

It's ironic that Microsoft so heavily invested in GenAI that made the problem much worse and is killing Github.

tekknolagi | 20 hours ago

Looks up at https://pierre.computer for me. Not sure why they switched

untitaker | a day ago

I would love to see a performance comparison with terminal-based reviewing tools like revdiff. I'm not necessarily expecting that pierre's diff will be slower, but it sure seems to take a lot of effort to get where they are today.

https://diffshub.com/torvalds/linux/compare/v6.0...v7.0

Loading this, I can't help but wonder why it streams the diff the way it does. It seems to go depth-first, i.e. top-level folders are not loading for a long time until all the children have been processed. I'd have liked top level folders to load instantly, but collapsed.

Is the actual diffing happening on github and they just load a huge patchfile?

aapoalas | 23 hours ago

During winter holidays I did a virtual scroller that I was quite proud of: I went fully with the requestAnimationFrame side and what I did was use a Struct-of-Arrays form in both the DOM and the source data, and rendered using a grid where the cells all use their row index as their CSS order property: the only thing I then need to do is rewrite the cell contents and set its order property, and the browser takes care of positioning it in the correct visual row. Finally just move the grid up or down to fine-tune the row placement and I had great virtual scroller tied to native scroll behaviour with great performance.

In my case it was easy to determine the rows so that made it easier than a diff might be, and I had multiple columns so a grid made a lot of sense in general.