IIRC vim became really slow with the combination of large source files (thousands of lines of code) and language server plugins (e.g. code completion and live error squiggles).
I was using vim-enhanced as red hat-based distro installed it. No customization. No customization of nvim either.
I often use vim or nvim on disposable machines, so persistent undo is something very low on my list of things I want.
I had a C program that was a single file 140,000 lines long back then. No issues.