[Haskell-cafe] Dead else branch does influence runtime?

Johannes Waldmann waldmann at imn.htwk-leipzig.de
Tue Jun 14 16:46:29 CEST 2011

On 06/14/2011 04:42 PM, KC wrote:
> How is the compiler to know the else branch is never executed at run-time?
> If you do, then why is it there in your source code?

The algorithm is divide-and-conquer, and I want to create sparks
as long as I have cores (capabilities), and use the linear
algorithm below that.

The bug report is that the linear algorithm (if called from
inside my program, at the leaves of the recursion tree)
is much slower than when called on its own.

This bug already shows when the tree has height 0,
but this is really just for the bug report -
in real life, both branches will be executed.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110614/2d2ef06c/attachment.pgp>

More information about the Haskell-Cafe mailing list