You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 5287 Reporter:@lefessan Assigned to:@xavierleroy Status: closed (set by @xavierleroy on 2012-09-25T18:06:17Z) Resolution: fixed Priority: normal Severity: minor Platform: all OS: all OS Version: all Version: 3.12.0 Fixed in version: 3.13.0+dev Category: ~DO NOT USE (was: OCaml general) Parent of:#5933 Monitored by:@ygrek@jberdine "Julien Signoles" @hcarty@alainfrisch
Bug description
Partial applications like (f x) where f has arity greater than 3 are expensive, since every application will lead to a closure allocation for each intermediary argument. Moreover, such functions are not inlined anymore.
This patch fixes these two behaviors:
in cmmgen.ml, caml_curry functions are modified so that they can be applied directly, when all the remaining arguments are provided. No allocation anymore for intermediate arguments.
in closure.ml, partial applications are detected, and, when the true arity of the function is known, an eta-expansion is performed.
Problems:
since approximations of arguments are lost during applications, the optimization is less interesting than with the patch I sent by email, but its complexity is unchanged (the "planck" parser of Jun could trigger an exponential complexity due to the recursive call to "close")
approximations are not known for external functions when they are bigger than the inlining threshold, so the transformation cannot be triggered for them, although it would be interesting.
Original bug ID: 5287
Reporter: @lefessan
Assigned to: @xavierleroy
Status: closed (set by @xavierleroy on 2012-09-25T18:06:17Z)
Resolution: fixed
Priority: normal
Severity: minor
Platform: all
OS: all
OS Version: all
Version: 3.12.0
Fixed in version: 3.13.0+dev
Category: ~DO NOT USE (was: OCaml general)
Parent of: #5933
Monitored by: @ygrek @jberdine "Julien Signoles" @hcarty @alainfrisch
Bug description
Partial applications like (f x) where f has arity greater than 3 are expensive, since every application will lead to a closure allocation for each intermediary argument. Moreover, such functions are not inlined anymore.
This patch fixes these two behaviors:
Problems:
File attachments
The text was updated successfully, but these errors were encountered: