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

reduce ndslice template bloat #4823

Merged
merged 2 commits into from
Sep 30, 2016
Merged

reduce ndslice template bloat #4823

merged 2 commits into from
Sep 30, 2016

Conversation

9il
Copy link
Member

@9il 9il commented Sep 29, 2016

There are 2 commits with different template bloat optimizations. auto ref was also removed.
This PR follows suggestions from @aG0aep6G and @timotheecour from the thread http://forum.dlang.org/thread/njcoyysqeqhbejxperyv@forum.dlang.org?page=1

@9il 9il added the ndslice label Sep 29, 2016
@9il 9il added this to the 2.072.0 milestone Sep 29, 2016
@JackStouffer
Copy link
Member

Do you have any data for the compile time speed difference?

@9il
Copy link
Member Author

9il commented Sep 30, 2016

No

@9il
Copy link
Member Author

9il commented Sep 30, 2016

Compilation speed for unittests is the same. But this is not a goal. Goal is more clean API, less function names in object files and in the documentation. A lot of prototypes was removed, but API functionality remains the same.

Copy link
Member

@andralex andralex left a comment

Choose a reason for hiding this comment

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

Looks quite a bit nicer, too.

@@ -513,6 +477,8 @@ private bool isValidPartialPermutationImpl(size_t N)(in size_t[] perm, ref int[N
return true;
}

enum toSize_t(size_t i) = i;
enum isSize_t(alias i) = is(typeof(i) == size_t);
Copy link
Member

Choose a reason for hiding this comment

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

Can you make all of these private or package?

Copy link
Member Author

Choose a reason for hiding this comment

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

std/experimental/ndslice/internal.d is public because it is required to remove existing ndslice modules from Mir but continue add new ndslice modules. So, it should be shared/public for now.

Copy link
Member

Choose a reason for hiding this comment

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

alrighty then

@@ -329,7 +329,7 @@ Returns:
n-dimensional slice of the same type
See_also: $(LREF swapped), $(LREF transposed)
+/
Slice!(N, Range) everted(size_t N, Range)(auto ref Slice!(N, Range) slice)
Slice!(N, Range) everted(size_t N, Range)(Slice!(N, Range) slice)
Copy link
Member

Choose a reason for hiding this comment

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

wait, this is a typo, should be reverted

Copy link
Member

Choose a reason for hiding this comment

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

Evert is a word, though 9il might have meant reverted,

Eversion (from the verb "evert") is the process of turning inside-out.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, this is not a typo.

Copy link
Member

Choose a reason for hiding this comment

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

cool thx! live and learn

@andralex
Copy link
Member

Auto-merge toggled on

@andralex andralex merged commit a725dbc into dlang:master Sep 30, 2016
@9il 9il deleted the templatebloat branch September 30, 2016 14:11
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.

3 participants