I leave this here for anyone struggling with this issue. I really like using eshell and tramp, but I was sad to see that in the default configuration for the eshell module in doom emacs, eshell+tramp is very slow.
After some profiling I discovered that it was company-mode’s fault, so I added this snippet that disables company-mode depending if we are on a remote server or not to my config:
(after! eshell
(add-hook! 'eshell-directory-change-hook
(company-mode (if (file-remote-p default-directory) -1 +1))))
It’s a bit bold to send to upstream but I can make a PR if there is any interest, else just copy and paste this to your config.el. Wonder if anybody else has tried a different solution?