-
-
Notifications
You must be signed in to change notification settings - Fork 212
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
Specialize ByteIterator in BinaryFen #619
Conversation
It's interesting that the import in the test of the extension just works, competing with the implicit def in predef. |
Thanks @som-snytt this looks great ❤️ We have benchmark for this BinaryFen, so I'll run it to see the result
Just wonder what scalac otions do you use to notice such a thing.
I think this is a good call, I don't agree with scalafmt a lot of time, but it's good to be consistent with code style.
I think we can make this class |
There is no different in the the benchmark within margin of error, maybe jit compiler takes care of the inlining things? master:
Pr:
|
Anything is possible with runtime. I noticed because of a bug with This was more of a learning exercise about array iterator. Normally I would not optimize without measuring. I noticed in the discussion about future |
I also don't see a change in the benchmark. I'll check using Edit: as expected, |
hey, thanks anyway! We at least can cherry pick your removing imports commit. I'm messing around with BinaryFen benchmark as it seems too simple (only one case) and compiler may constant folds it.
Do you suggest to replace |
new benchmark code #620 and still nothing significant. |
Noticed in Scala community build.
The iterator tries to inline to the underlying without much success.
The latest Scala will rewrite unused imports, so that's a second commit.
As a footnote, "bare iterators" should normally extend
collection.AbstractIterator
to save on members.