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

Change some arguments from T::Type::Type{T} #10989

Closed
wants to merge 1 commit into from

Conversation

mbauman
Copy link
Sponsor Member

@mbauman mbauman commented Apr 24, 2015

Some of these were likely doing just fine because they got inlined (in which case I think this change is purely cosmetic). And while this may cause more specialized methods to be compiled, I believe that these are cases where we want them to be specialized. That said, I'm unfamiliar with these portions of the codebase (cc @Jutho for concatenation, @tanmaykm for readdlm) and these were purely mechanical changes spurred by #10988 (ack '::(Data)?Type[^{]' base).

This may help readdlm performance (#10428), but I've done no testing.

Some of these were likely doing just fine because they got inlined (in which case I think this change is purely cosmetic).  And while this may cause more specialized methods to be compiled, I believe that these are cases where we want them to be specialized.  That said, I'm unfamiliar with these portions of the codebase (cc @Jutho for concatenation, @tanmaykm for readdlm) and these were purely mechanical changes spurred by JuliaLang#10988 (`ack '::(Data)?Type[^{]' base`).

This may help readdlm performance (JuliaLang#10428), but I've done no testing.
@@ -38,16 +38,16 @@ function countlines(io::IO, eol::Char)
nl
end

readdlm(input, T::Type; opts...) = readdlm(input, invalid_dlm, T, '\n'; opts...)
readdlm(input, dlm::Char, T::Type; opts...) = readdlm(input, dlm, T, '\n'; opts...)
readdlm{T}(input, ::Type{T}; opts...) = readdlm(input, invalid_dlm, T, '\n'; opts...)
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

A 1-line function like this that just passes its arguments through is a perfect example of a case where you don't need to specialize on every value of T.

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

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

Is it treated differently upon inlining? I was under the (perhaps misguided) impression that this was also the better style in general. I'll re-examine this PR with more consideration.

@mbauman mbauman closed this Apr 25, 2015
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