Browsers can deal with very long documents. Ctrl+F works like a breeze on HTML that's 100K lines long.

Browsers only struggle to run heavy JS frameworks that wrap every line in a dozens of spans with dozens of handlers and mutate it all on every line scrolled.