Comment by charcircuit

14 hours ago

Keep things as simple as possible and put the whole thing in the DOM. Then if there are performance problems address the scaling problems themselves instead of trying to avoid scaling. For example things like only rendering what is visible should be handled by the browser and not by messing with the DOM. The DOM is not synchronized with the browser's renderer so it will always end up hacky.

OK but thats simply doesn't perform.

You can't say "only rendering what is visible should be handled by the browser" and call that a solution unless you have a magic wand to make Chrome/other browsers do this.

The browser doesn't do this, and so you can either do what you say and have your browser freeze when you load up a million line diff, or you can fix things within your control which is what the author is doing.

  • I just tested it now and Chrome does not freeze when opening up a page with a million lines of code. I repeated a file from the Linux kernel 600 times to reach over 1.1 million lines and I put each line in a div so I could alternate red and green background colors.

    >you can fix things within your control

    Blink is open source. Improving the browser is fully within your control and since browser automatically updates these optimizations will make it to your end users in a relatively short amount of time.

    • Would love to see a website that makes everything DiffsHub does without making any of the work necessary. Making it all obsolete would be a huge step forward for the web. We support diffs that exceed 36 million lines, with syntax highlighting, comments, bundled into a reusable library for anyone to use.

      Also this works in all browsers, fixing blink doesn’t help move the web forward.

      3 replies →