Skip to content

Conversation

jmdavis
Copy link
Member

@jmdavis jmdavis commented Jul 16, 2011

I optimized std.array.join for arrays (not just strings). It's definitely more complicated now (it doesn't use std.algorithm.joiner anymore when dealing with arrays and ended up with several overloads), but it should be much more efficient for arrays, since it now copies them whole rather than element by element.

http://d.puremagic.com/issues/show_bug.cgi?id=6064

I also went over the other functions in std.array and made them work
with immutable arrays where applicable. The unit tests have been
appropriately expanded as well.
@CyberShadow
Copy link
Member

Thanks! I didn't think so much effort was required for this.

jmdavis added 2 commits July 16, 2011 00:31
The idea is to make the template constraint match exactly what the user
needs to instantiate it rather than seeing the more complex template
constraints that the various overloads of join have. Not that the
resulting template constraint is altogether short either, but it's now
the bare minimum which all join overloads must match rather than
including the specifics necessary to distinguish each overload.
@jmdavis
Copy link
Member Author

jmdavis commented Jul 16, 2011

It didn't take all that long to write it, but it did get a bit complicated with all of the combinations. Unfortunately, it looks like I managed to mix my changes for #143 into here (that and a commit called temp which I just rebased away). So, it looks like that commit needs to be merged in first. But it's not particularly complicated (just a bit tedious), so hopefully it won't take all that long for that to be merged in. You can just ignore the first commit "Made std.array.replace work with immutable arrays again" in this pull request. If you want to comment on those changes, comment on them in pull request #143.

dsimcha added a commit that referenced this pull request Jul 16, 2011
Issue 6064: std.array.join is unnecessarily slow for strings
@dsimcha dsimcha merged commit 55fc7a2 into dlang:master Jul 16, 2011
kuettler pushed a commit to kuettler/phobos that referenced this pull request Feb 6, 2018
rdmd: Don't recompile the program if only current directory changes
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