-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Prefer ownersIterator #10713
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
base: 2.13.x
Are you sure you want to change the base?
Prefer ownersIterator #10713
Conversation
It would be nice to demonstrate actual benefit. It would be nice if it could be automated. Possibly "eliminate intermediate collection" is just "insert It's nice that the lint in 2.13.13 works (if backticks are removed):
|
Noticed an ancient commit for this change, so it's a forever issue. Maybe the API should be LazyList, or it really needs |
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.
seems mergeable to me. tinkering carries a slight risk, and any performance improvement would likely be smaller than measuring error, but historically we have tended to merge such small speed improvements as long as they don't degrade code quality
People hate "intermediate collections" so much more than either "advanced" or "elementary" ones. |
3681c18
to
8eb5619
Compare
I'm still at the "these are just numbers" stage, but I rediscovered the
as suggested.
2.13.14 drops from 625 to 2700, this PR from 728 to 967. I don't know what the scores mean yet. I don't know if that is better than not knowing the number. |
Is this the only thing that's changed since .14? Otherwise, you really should compare before/after this PR alone. The count isn't high enough to know whether the 2700 vs 970 number is real--that corresponds to the slowest sample in every case. Otherwise, the whole histogram seems to show .14 as faster. |
still just numbers. But worth adding, these are optimized local builds. More to the point, I'd like my local workflow to always include benchmarking (with history to consult). |
Hm, second one seems like it might be a little slower for real. But it's so close that I wouldn't believe it unless you go back and forth a couple times. |
This comment was marked as off-topic.
This comment was marked as off-topic.
i was trying to reproduce, do you have patches for compiler-benchmark to make things work? the repo seems a bit outdated. |
I commented out old dotty refs and updated Scala to 2.13.14 but nothing else. (Hence my first run with vanilla 2.13.14.) Otherwise, I just set the compiler version and ran with it. I hope to return to it later. I remember several years ago, I failed to get reliable results on my fancy box at work running Ubuntu natively. Now I'm running under WSL, so I don't know if there are architectural limitations. |
Not quite closing yet, but converting to draft until I have some time to pursue proper benchmarking. The PR itself is just a moral statement about style. If retronym didn't notice anything in 2017, why should I play diesalbla now? |
When using
ownerChain
to search, preferownersIterator
to creating and discarding a list.A
find
may not even examine all owners.