Hugs.c, main loop patch

Neil Mitchell ndmitchell at gmail.com
Mon Sep 5 09:21:11 EDT 2005


Hi,

This is the most invasive change in the hugs directory, and the last one.

Split the main loop into invoke (which performs the computation) and
prefix (which sets up the required bits). Change the main loop to call
while(1){prefix(); invoke();} for the standard hugs. WinHugs now uses
the normal windows message pump which gives it much better performance
and no polling. It does this by calling invoke directly.

If people would like to see revisions to this patch just ask, its a
little more violent than I would like, but I'm not sure there is any
better way. If you look at the code for the non-winhugs path, it comes
out identical to what was being called before.

With this patch, on Windows WinHugs now outperforms the standard
console version by about 2 times in output intensive programs ([1..]),
and is the same for compute intensive ones (nqueens).

Thanks

Neil
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main-loop.patch
Type: application/octet-stream
Size: 4474 bytes
Desc: not available
Url : http://www.haskell.org//pipermail/cvs-hugs/attachments/20050905/c0ee3456/main-loop.obj


More information about the Cvs-hugs mailing list