Re: [pure-lang-users] Patch to compile Pure with LLVM upstream
Status: Beta
Brought to you by:
agraef
|
From: Jiri S. <jir...@bl...> - 2008-07-08 17:53:29
|
Albert Graef wrote: > I found that adding special case rules to avltree.pure only yields > marginal improvements (<10%), so you might be able to remove them from > your implementation, too, without taking a major performance hit. That > alone will make your modules load much faster, and there's some other > refactoring that we can do (like checking the balance factor in a guard > instead of matching it on the lhs) that will further reduce the number > of overlapping rules. > OK. Testing set is now in 'examples/set_test.pure'. Removed type annotations don't hurt. I changed pattern matches of constants to guards where possible. The result does not seem to compile any faster (at least on my PC) and the execution is substantially slower :-( . Do you see any other possible rewrites of the code? I looked at other similar implementation of AVL trees (I already mentioned it somewhere in the Q discussion). It doesn't use those 'table' and 'table2' to calculate the new balances, there is some div/mod/&/| magic instead. The rest of the code is almost the same. This variant of the algorithm was only by about 30 % faster than Bird/Wadler in Q. I don't think it would compile much faster than the current one. Jiri |