Call Arity: Trade precision for performance in large mutually recursive groups
authorJoachim Breitner <mail@joachim-breitner.de>
Wed, 15 Apr 2015 14:25:13 +0000 (16:25 +0200)
committerJoachim Breitner <mail@joachim-breitner.de>
Thu, 16 Apr 2015 12:06:44 +0000 (14:06 +0200)
commit9654a7cf8580bc3a027bf8b39c06d916050c446d
tree2d8499506a69e20dd4ca66a00d9feba9631bd64a
parenta9ca67f6bfb45d13944ba15452d3af613ec84d8b
Call Arity: Trade precision for performance in large mutually recursive groups

Sometimes (especial with derived Data instances, it seems), one can have
very large mutually recursive bindings. Calculating the Call Arity
analysis result with full precision is an expensive operation in these
case. So above a certain threshold (25, for no good reason besides
intuition), skip this calculation and assume the recursion is not
linear, which is a conservative result.

With this, the Call Arity analysis accounts for 3.7% of the compile time
of haskell-src-exts. Fixes #10293

Differential Revision: https://phabricator.haskell.org/D843
compiler/simplCore/CallArity.hs