This appears to have been due to this issue in projectile, which I use.
I followed the suggestion in a comment on that issue of using this workaround:
(add-hook 'find-file-hook
(lambda ()
(if (locate-dominating-file default-directory ".git")
(projectile-mode))))
i.e. removing
(global-projectile-mode)
from my .emacs
and replacing it with the above code, and performance is now acceptable (there is a lag on opening the file, and on the first keypress that makes an edit to the file, as I would expect). This does mean that projectile is only activated in git projects, but that's fine for me - and the same workaround can easily be extended to other version control systems if necessary.