16 Feb
2008
16 Feb
'08
5:22 a.m.
On Sat, Feb 16, 2008 at 12:45 AM, John Meacham
On Fri, Feb 15, 2008 at 03:34:59PM +0100, Lemmih wrote:
The attached patch is a two-step optimization: 1) Only call 'getType' 100,000,000 times instead of 600,000,000 times. 2) Greatly simplify the actual loop.
Without this patch, compiling base-1.0.hl takes 19 minutes. With this patch, compile time is down to 11 minutes. Feedback would be greatly appreciated.
I am confused, what in the patch causes getType to be called less? As far as I can tell it is just replacing equality checks with 'isFoo' predicates.
E.Values.isCheap checks whether its argument is atomic. The 'isAtomic' function is very expensive so I moved it down below the four static checks. -- Cheers, Lemmih