Sorry, I couldn't recreate this. I just built a tiny texteditor app:
https://65cd02a1-8f00-47cb-b1d1-231493de5fc2.paged.net/
Tried putting 20k lines into it. Loaded instantly, allowed me to scroll and edit flawlessly.
But I get your point. I'm on a pretty decent 2022 iPhone, and I'm sure at some stage I would run into a performance hit. But not at 20k lines.