Skip to content

function inlining can prevent optimization #226

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
hhugo opened this issue Sep 10, 2014 · 4 comments
Closed

function inlining can prevent optimization #226

hhugo opened this issue Sep 10, 2014 · 4 comments
Assignees

Comments

@hhugo
Copy link
Member

hhugo commented Sep 10, 2014

inlining the code of an optimizable function could make this code unoptimized
https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#2-unsupported-syntax

@vouillon
Copy link
Member

Indeed, we should probably disable inlining when any of the inner or outer function contain a try...with.

Also, at the moment, the toplevel of all modules are concatenated, so if there is a try...with at toplevel in any of the modules, this will affect all other modules.

@hhugo
Copy link
Member Author

hhugo commented Sep 16, 2014

partially implemented in #230
Do you see a way to split toplevels of modules into their own functions ?

@hhugo
Copy link
Member Author

hhugo commented Sep 28, 2014

here is a simple example that fails because of the wrapping of try catch in toplevel.

let x = try 5. ** 2. with e -> raise e
let f y = y +. x
let _ = print_float (f 1.)

@Drup (is not a bug). This is the bug responsible of Failure("Some variables escaped (#1)")

@hhugo hhugo reopened this Sep 28, 2014
@hhugo
Copy link
Member Author

hhugo commented Sep 28, 2014

@vouillon , I have disabled try-catch wrapping for now (24f13d6)

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants