Skip to content
New issue

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

avoid specializing convert for Any result types #25

Closed
wants to merge 1 commit into from

Conversation

stev47
Copy link
Contributor

@stev47 stev47 commented Aug 4, 2023

Specializing convert(Result{Any, E}, x) for every type of x can incur substantial compilation overhead (not only on convert but also on Some). This change avoids specializing in case of explicit Any result type.

This is analogous to Julia Base where we have

convert(::Type{Any}, Core.@nospecialize x) = x

to avoid excessive specialization.

Specializing `convert(Result{Any, E}, x)` for every type of `x` can
incur substantial compilation overhead (not only on `convert` but also
on `Some`). This change avoids specializing in case of explicit `Any`
result type.

This is analogous to Julia Base where we have
```
convert(::Type{Any}, Core.@nospecialize x) = x
```
to avoid excessive specialization.
@0x0f0f0f
Copy link
Collaborator

Superseded by #27

@0x0f0f0f 0x0f0f0f closed this Jul 30, 2024
0x0f0f0f added a commit that referenced this pull request Jul 30, 2024
 avoid specializing convert for Any result types (superseding #25)
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