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
Vector: Fix 2.13.2 performance regression: Restore special cases for small operands in {append,prepend}edAll #9036
Conversation
9481081
to
5d2b94c
Compare
5d2b94c
to
f77cccb
Compare
f77cccb
to
c891e92
Compare
c891e92
to
0e8a5f8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed a small cleanup.
|
||
override final def appendedAll[B >: A](suffix: collection.IterableOnce[B]): Vector[B] = { | ||
val k = suffix.knownSize | ||
if(k == 0) this | ||
else appendedAll0(suffix, k) | ||
} | ||
|
||
protected[this] def prependedAll0[B >: A](prefix: collection.IterableOnce[B], k: Int): Vector[B] = { | ||
val tinyAppendLimit = 4 + vectorSliceCount | ||
if (k < tinyAppendLimit /*|| k < (this.size >>> Log2ConcatFaster)*/) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
incorrect assumption that k
is positive
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea if this is the source of scala/bug#12564, but it might be
Fixes scala/bug#12027