Skip to content

add compiler patch (cf ocaml/ocaml#406)#5

Merged
dwightguth merged 1 commit intomasterfrom
ocaml
Jan 20, 2016
Merged

add compiler patch (cf ocaml/ocaml#406)#5
dwightguth merged 1 commit intomasterfrom
ocaml

Conversation

@dwightguth
Copy link
Copy Markdown
Contributor

@chathhorn please review

Should shave about 200 ms off the time to kcc.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this faster, out of curiosity? Why is the last case not "_ -> false"?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is faster because polymorphic comparison is super slow. The idea behind the last case is that by writing it this way, it's not any slower once compiled, but if a new case is added to the constructor_tag type, a warning will be outputted that this function is no longer correct. I implemented it this way at the request of the OCAML developers after I submitted the original PR to them.

@chathhorn
Copy link
Copy Markdown
Contributor

Ok, looks good then.

dwightguth pushed a commit that referenced this pull request Jan 20, 2016
@dwightguth dwightguth merged commit 04f9927 into master Jan 20, 2016
@dwightguth dwightguth deleted the ocaml branch January 20, 2016 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants