-
Notifications
You must be signed in to change notification settings - Fork 59
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
Chunk.Indexed extends IndexedSeq #967
Conversation
I'm fairly confident this is not worth doing. First of all, I attempted to write a version of this with I am planning a PR to hand optimize some |
Ah, I see, fair enough... |
I've played with it a little bit, maybe you'll find this helpful @hearnadam |
My fear is that this leaves common patterns very susceptible to being pushed off the hot path.
Is there a particular optimization we can get from IndexedSeq that I am missing? |
Not that I know of. What prompted me to do this is that I believe interoperability, especially via standard library, is very important. Like e.g. implementing the corresponding interfaces ( But that leaves us in a pickle. For something to be an
One another, slightly more involved solution to this that I see is to
Now, that is a bigger rewrite. Or we can just leave things as they are, not bothering with |
I'd prefer to avoid adding new interfaces to the implementation because of the potential performance implications. @sideeffffect in case you see concrete use cases for them, please open an issue elaborating the necessity so we can discuss it. I'm closing this for now, I hope it's ok. |
UPDATE:
Chunk.Indexed now extends IndexedSeq
It probably makes sense for
Chunk
to extendIndexedSeq
. That in turn requires to extendIndexedSeqOps
.The potential con is that more mixins may make it more difficult for the JIT compiler to optimize the code.
Context
What do you think, is it worth it?