To my

| I am puzzled with the following effect in  ghc-4.04, 06.
| In certain large program
|                                           f x = let  XX...
|                                                      p = ...
|                                                      YY...
|                                                 in   r p
| p  is found respectively cheaply from  x,  
| r  is found expensively via  x, p.
| Now, without having profiling, I want to know what part of the time 
| cost takes evaluating  p.
| For this, I replace  `r p'  with     error $ show p.
| 
| And it takes 1000 times more than computing  p  by separate program,
| without `YY...' part.



Simon Peyton-Jones <[EMAIL PROTECTED]>  responds

> I think you are saying that YY is dead code, but still affects runtime
> dramatically.  I can't account for this; it sounds implausible.
> The best thing would be to use profiling
>       p = _scc_ "p" ....


I am sorry:   r p  is found expensively via  x, p and YY part too.
And after replacing `r p'  with  error $ show p
YY becomes indeed a dead code.
But the run-time overhead was as if this YY mattered.
Though, the whole example is too complex, I would hardly provide a 
conctete report.
I shall see further, maybe try profiling - if it works.

------------------
Sergey Mechveliani
[EMAIL PROTECTED]



Reply via email to