-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Avoid inheriting suboptimal concat implementation for immutable collections #7166
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
Conversation
397f6f0
to
f9ee21e
Compare
Needs a rebase, and updates to some tests. Looks good to me, but probably @szeiger should review this too. |
ac31fbe
to
b49a98e
Compare
b49a98e
to
a635a2a
Compare
/rebuild |
Pinging @odd. This still has some test failures and also needs to be rebased. |
@szeiger The purpose of this PR was to avoid the performance degradation introduced by the Instead I then started looking at the actual cases where a sub-optimal implementation from a So, in conclusion, this PR might be a bit too far reaching (if the lubs containing structural types are seen as something to avoid), or perhaps it is not going far enough (by removing |
Right, the lubs are ugly:
This is what you get without these changes:
Is there a ticket for this or some discussion why they occur? The traits contain only overrides and |
There's scala/bug#10908 |
I'm closing this because we don't want to introduce more ugly lubs and there's already a ticket for that (and alternative fixes for the issue at hand). |
Fixes scala/bug#11128 by separating the
StrictOptimizedOps
-family of traits into one set for mutable collections (which continue to use the builder basedconcat
/appended
/appendedAll
/prepended
/prependedAll
/padTo
implementations) and another set for the immutable collections (which does not have the builder based implementations since they have implementations inherited from e.g.immutable.SetOps
that are more optimal). The rootStrictOptimizedIterableOps
-trait is still left in thecollection
package and is inherited by the specific implementations in the mutable/immutable subsets.