Fix performance regression in bufferSliding#1217
Conversation
| def newBuilder[From, A, C](bf: BuildFrom[From, A, C], from: From): mutable.Builder[A, C] = bf.newBuilder(from) | ||
|
|
||
| @inline def toSeq[A](array: Array[AnyRef]): Seq[A] = | ||
| new scala.collection.immutable.ArraySeq.ofRef(array).asInstanceOf[Seq[A]] |
There was a problem hiding this comment.
It will be hard to keep track of these internal helpers.
There was a problem hiding this comment.
Any ideas? Alternatively, it could be placed in reactive (it has only one usage) but it would be even more scattered then.
I have put it in private [monix] in case we can delete it one day.
Initially I wanted to point to the same ArraySeq but mutable one doesn't perform well in my benchmarks. It seems like toSeq is quite expensive there.
There was a problem hiding this comment.
We'll have to remember we have it I guess.
|
I'm running benchmarks again and the results are all over the place, I'll rerun it over the night with Slack/Chrome/etc. closed |
|
I've run it more times and it seems to be OK: Still a lot of variance in some results between runs but there's consistent trend that it might be even slightly faster on Scala 2.13 now |
|
I think that's fine. You would help me if you merged this, given your 2.13 upgrade 🙂 |
I also updated to Scala 2.13.3 - sorry for the noise
2.12:
2.13, before the change:
2.13, after the change: