We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Original bug ID: 4808 Reporter: jerhoud Status: resolved (set by @xavierleroy on 2012-04-08T17:35:02Z) Resolution: suspended Priority: normal Severity: feature Version: 3.10.2 Category: ~DO NOT USE (was: OCaml general) Duplicate of: #5541 Monitored by: @ygrek @hcarty
Pervasives functions min and max never get inlined because they are polymorphic.
Using min or max on int values implies 2 function calls (one to min or max and an indirect one to caml_lessequal).
A specialized version of min and max for type int gets inlined in ~4 simple assembler instructions.
A nice feature would be that polymorphic functions get inlined using the knowledge of the actual types of the arguments.
If this is too complicated (or not worth the work) perhaps min and max could be special for the compiler (like '<' is)
The text was updated successfully, but these errors were encountered:
Comment author: @xavierleroy
Suspending this PR for reasons explained in #5541
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Original bug ID: 4808
Reporter: jerhoud
Status: resolved (set by @xavierleroy on 2012-04-08T17:35:02Z)
Resolution: suspended
Priority: normal
Severity: feature
Version: 3.10.2
Category: ~DO NOT USE (was: OCaml general)
Duplicate of: #5541
Monitored by: @ygrek @hcarty
Bug description
Pervasives functions min and max never get inlined because they are polymorphic.
Using min or max on int values implies 2 function calls (one to min or max and an indirect one to caml_lessequal).
A specialized version of min and max for type int gets inlined in ~4 simple assembler instructions.
A nice feature would be that polymorphic functions get inlined using the knowledge of the actual types of the arguments.
If this is too complicated (or not worth the work) perhaps min and max could be special for the compiler (like '<' is)
The text was updated successfully, but these errors were encountered: