tags:

views:

391

answers:

5

Is there a way to improve emacs tramp performance? For me it's faster to open an external ftp client (filezilla), transfer files to the local disk and open them in an external editor (notepad) than open them with emacs. I use emacs23.1 under windows xp. I tried different tramp-default-method (telnet, pscp, ftp), all of them have the same performance.

Profiling results with elp-instrument-package are the following (I opened 3 remote files of 1.5 MB each one)

tramp-file-name-handler                                1461        350.41599999  0.2398466803
tramp-sh-file-name-handler                             1461        350.02699999  0.2395804243
tramp-send-command                                     227         179.63400000  0.7913392070
tramp-send-command-and-check                           205         177.77600000  0.8672000000
tramp-wait-for-regexp                                  227         176.47800000  0.7774361233
tramp-wait-for-output                                  226         176.40000000  0.7805309734
tramp-barf-unless-okay                                 18          133.46699999  7.4148333333
tramp-handle-insert-file-contents                      3           132.046       44.015333333
tramp-handle-file-local-copy                           3           131.281       43.760333333
tramp-accept-process-output                            2375        112.95100000  0.0475583157

So, actual file transfer takes 132 sec, about 1/3 of total time. Why does it spend so much time in tramp-sh-file-name-handler? I tried to advice a function tramp-sh-file-name-handler to store and return cached results but it does not work, probably this function has some side effects.

Any ideas how to improve tramp performance? (I use emacs 23.1 under WindowsXP)

A: 

I have the same problem under XP (but not under linux), and - sadly enough - know of no fix.

But instead of notepad as external editor to filezilla, I use emacsclient. This works pretty ok.

niels giesen
Of course, I use emacs as an external editor as well. My point is that tramp is much slower than command line ftp or filezilla ftp.
Oleg Pavliv
+1  A: 

I've found that fuse-ssh is far better than tramp mode, if you can set it up that way.

Randal Schwartz
Thanks for your answer. I didn't find an easy way to setup fuse on windows. There is a Japanese project Ducan, which is supposed to do something similar but I wasn't able to install it. Do you know how to make it work under Windows?
Oleg Pavliv
Not a windows user, sorry.
Randal Schwartz
A: 

if your use case improves, use remote client! I have resorted to editing remotely with emacs, this reminds me.

my experience has led me to believe the machine hosting emacs would be the bottleneck

however a better SSH client may help... try the list at OpenSSH.org (low in the left nav) I like PuTTY on Windows, where selection=copy & right-click=paste.

not sure of ways to improve the remote performance, though. the default build of emacs has a lot of lisp but it takes more disk than RAM space, and has always been efficient for me excepting large files & net/sys lag.

if your case has highlighting and auto-features you don't want, then configuring minimally might help - should be able to do that without rebuilding.

emacs is so vast, I noticed most when I found out it can send/receive e-mail. I have hardly explored the tip of the iceberg.

in this case though 'vi' may be better... even with more emacs experience relatively I've used small portions in each camp. rarely do I script or seek out a new feature, the digging is tough but there are handy command guides for both.

GeeKieR
Thanks for your answer. I need to connect from my client to different remote machines, so a remote client is not a solution for me. Yes, I can use vi but I created a lot of scripts for emacs which I need. And I use emacs as a file manager, not only as an editor.
Oleg Pavliv
A: 

I resolved a problem by a couple of scripts which allow me to mget/put and mirror files or directories. These scripts use lftp (a version which is installed with the cygwin) and have a very good performance.

They were demands to publish my solution. Unfortunately, I have only a prototype of it. I have no time to finish it. It serves me well but it's not in the state to be published.

Oleg Pavliv
A: 

Oleg, could you provide your solution here for the rest of us to reference?

phils
I have only a prototype of it. It serves me well but, unfortunately, it's not in the state to be published.
Oleg Pavliv