Live data from Hacker News

On Rendering Diffs

pierre.computer

31–40 of 73 posts

Re: On Rendering Diffs

#31
It's cool seeing all the engineering that goes into optimizing performance of diffs. I'm working on a FreeCAD workbench that generates diffs on CAD model trees[0], and although my bottlenecks are a bit different, I can still implement some of your optimizations down the line if needed (such as deferred syntax highlighting).

My main bottleneck is that I do a complete diff on all open + changed documents in the repository up front, because due to how document properties are stored, I won't know if the file has meaningful changes until I compute the full diff (FreeCAD may save the document, but not have anything meaningful change.)

[0] https://github.com/eblanshey/HistoryWorkbench

Re: On Rendering Diffs

#32
I feel like virtualization is not the right way to handle things. It adds so much complexity and makes the user experience buggy due to breaking optimizations and features of browsers.

Computers are very powerful these days and have a done of resources that they can use. We should be able to handle large diffs without any crazy tricks.

Re: On Rendering Diffs

#33
post #2

A bit of a technical deep dive into how we built CodeView, a review surface that can handle rendering diffs of immense size, all in a browser.

Feature request; `git diff --color-moved` uses colors to display moved chunks of code. Scanning https://diffs.com/docs it isn't obvious that yall support that; please add it :)

Re: On Rendering Diffs

#34
post #25

Earlier quoted context omitted.

> disagree with the theory that scrolling frame rate doesn't need to be smooth for scrolling to feel smooth It's possible you might be misunderstanding what I was trying to say here because 120hz scrolling on a 120hz device was the goal and why one of those virtualization techniques was not acceptable to me which lead me to coming up with a novel workaround to this problem (Inverse Sticky Technique). CodeView uses a…

Even the linked ghostty PR on your home shows this - this is Firefox Android on a Nokia XR21 / TA-1486. It's not unuseable, but it definitely feels like 'js hacking my scrolling' and not a native surface flinging around. The experience is actually worse with smaller movements, i guess because my brain is more conscious when breaking the 'finger physically moving the text' illusion. I don't mean to be dismissive - you…

Maybe i need to buy one of these devices to test.

Just to be clear tho, we don't actually scroll jack, native scrolling works as it should and content should move with normal gpu composited scroll. That said, it's possible that loading that much data into memory may be causing causing knock on effects somehow that are just slowing everything down.

Re: On Rendering Diffs

#36

When producing TreeTrek, I went with rudimentary diffs that account for colourblind developers: https://repo.autonoma.ca/repo/treetrek/commit/3fe9360599ae23... The diffs rendering library looks amazing: https://diffs.com/ Presumably the red-green issue is a simple CSS update?

Yup! You can pick from a bunch of different themes and use css variables to override the core colors as well!

Re: On Rendering Diffs

#38
Is this really a hard problem? Rendering some text with coloring?

I believe we're just making everything harder than it needs by constraining it to a browser interface. This would be trivial as a terminal application written in native code.

Re: On Rendering Diffs

#39

Is this really a hard problem? Rendering some text with coloring? I believe we're just making everything harder than it needs by constraining it to a browser interface. This would be trivial as a terminal application written in native code.

Yeah, my bad. Sorry i wasted your time :(

Re: On Rendering Diffs

#40

Is this really a hard problem? Rendering some text with coloring? I believe we're just making everything harder than it needs by constraining it to a browser interface. This would be trivial as a terminal application written in native code.

What are you even talking about, this post is about rendering code diffs in the context of the web.

Whether or not it would be "trivial" in a native terminal application is irrelevant.

Post reply on HN