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 isEmpty is slow #6167
Comments
Imported From: https://issues.scala-lang.org/browse/SI-6167?orig=1 |
@soc said: This in turn invokes @inline override def iterator: VectorIterator[A] = {
val s = new VectorIterator[A](startIndex, endIndex)
initIterator(s)
s
} Using |
@retronym said: |
@soc said (edited on Aug 1, 2012 9:19:23 PM UTC): Pull request: scala/scala#1036 Edit: Sorry, Jason, I saw your comment too late. I'll look into it. |
@soc said (edited on Aug 1, 2012 9:21:25 PM UTC): |
@retronym said: |
@soc said: @juha: The fix is different to the code you proposed, because we tried to enable other collection classes to benefit from this change, too. Would you be so kind to check if the performance improvement is what you expect, and re-open this ticket if not? |
Vector should override isEmpty:
override def isEmpty = length == 0
Expect five fold performance increase in head, tail, last and init :)
The text was updated successfully, but these errors were encountered: