Speed comparison of NTEmacs and Cygwin Emacs

I may have mentioned previously that I'm using a Windows XP box as a Netware client at work. As I prefer the Unix way of doing things otherwise, I've been installing lots of Unix software on this box. The two main components are Cygwin, which is essentially a Unix-like environment including all essential GNU tools, and the native GNU Emacs port. The latter is built with MinGW, the "Minimalist GNU for Windows" tools. The native port has been around for years, I must have been using it for more than a decade now. However, Cygwin has also provided an Emacs port for a while. This one either runs in your terminal (like MinTTY), or as a GUI app if you use Cygwin's X server. A speed comparison made me think twice about my previous choice.

I'm using planner-mode to organize my lab projects, and I usually start every work day by creating my HTML task list which doubles as my browser homepage. As my projects continue to grow, creating the task list took an increasing amount of time. As Emacs isn't multithreaded, Emacs would be locked up while I wasn't able to get much done. And even if it were multithreaded, it would still be unusable as the CPU load goes up to 100% due to hardware limitations. A week ago or so I was approaching the 10 minute barrier, and I decided that something must happen (don't ask why I was so patient until then). With a little help from Jim Ottaway I was able to do some profiling, and it turned out that NTEmacs spent half a second per page (in a 1000 page project!) to decide whether or not to publish this page to HTML. Publishing of the page was rather fast compared to that. I was interested if this was a Windows or NTEmacs peculiarity. To find out, I cloned the project to my FreeBSD laptop. Publishing took approx. 20 seconds, which is about 30 times faster. The hardware is more recent, but I wouldn't expect more than twice the speed based on the hardware differences.

Now the interesting test was to find out if Cygwin Emacs was closer to Unix or closer to Windows. I upgraded my Cygwin installation from 1.5.x to 1.7.1, as the X server of my older installation wouldn't work properly. The new version run ok, and off went the tests. Turned out that Cygwin Emacs was even faster than the FreeBSD version. So the planner-mode speed problem was solely due to a speed problem in the native Emacs port.

Here is a comparison of two function calls. The first number indicates the times the function is called, the second one is the total time in seconds spent in the function. The first function is close to the overall processing time, whereas the second one roughly indicates the processing time of individual planner pages.

muse-publish-markup-region 4 880.836
muse-project-publish-file-default 979 443.916

Cygwin Emacs
muse-publish-markup-region 4 11.225999999
muse-project-publish-file-default 979 12.124000000

It is pretty obvious that NTEmacs has serious speed issues here. I'm well aware that this is not a serious benchmark or anything, but it is definitely something which I have to consider in my workflow. With that in mind I've decided to switch to Cygwin Emacs, the lack of file drag&drop support notwithstanding.


Noch keine Kommentare

Mein Kommentar

Dieser Artikel ist geschlossen. Keine Kommentare mehr möglich.