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
"Improve" root import filter for universal members #8547
Conversation
Instead of elaborate import selector machinery, just filter at ImportInfo.
|
||
@tailrec | ||
private def transformImport(selectors: List[ImportSelector], sym: Symbol): List[Symbol] = selectors match { | ||
case Nil => Nil | ||
case sel :: Nil if sel.isWildcard => List(sym) | ||
case sel :: Nil if sel.isWildcard => | ||
if (isRootImport && definitions.isUnimportableUnlessRenamed(sym)) Nil |
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.
i.e. isUniversalMember
, but using this method for uniformity with the main case above. allImportedSymbols
is used for completions.
As we say in testing, "I must be doing something wrong." I ran some tests during lunch. I expected to see a number, then a number that got bigger, and then another number that got smaller. Yes, I read the part where: "Do not assume the numbers tell you what you want them to tell." |
I am seeing a speedup:
Your numbers look suspiciously slow (in the base line and in the patched version). Maybe there is another factor dominating the the performance? What hardware + OS did you use? |
I'll get more experience with it and also not do any gaming while running tests (kidding). Thanks again for the code hint. |
Running benchmark on home Dell i7 with SSD, Ubuntu subsystem under windows, instead of office Dell xeon Ubuntu with fidget spinner disks yields smaller numbers. Smaller is better, right? |
Yep, smaller is better. |
Instead of elaborate import selector machinery,
just filter at ImportInfo.
Follow-up to #8541 with JZ's clever suggestion.
He really doesn't like it when you mess up his benchmarks.