adventure with profiling

Serge D. Mechveliani mechvel at botik.ru
Mon Jan 24 06:52:25 EST 2005


The pro-filing has proved its power once more.

My complex program has a fragment which generates many arithmetical
expressions, filtering out `reducible' ones and nub-bing them with
respect to the commutativity of some operators.

I expected the `reducible' test to take most of the cost.
But the whole program has taken suspiciousely long.
The profiling showed that  nub_by_commutatitvity (nub) takes 10 times 
more than the `reducible' test. 
It was hard to discover this without profiling, because the program 
has many places to suspect.
Then, I tried for this fragment  (setToList . mkSet)  instead of  nub 
!
The whole test has become faster 8 times!
`nub-like' reduced to 0.01;
the `reducible' test takes 3/4, as it was initially expected.
Quite an adventure.

-----------------
Serge Mechveliani
mechvel at botik.ru

 









More information about the Glasgow-haskell-users mailing list