Skip to content

Add space complexity tracker for #9203 #9237

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

Closed

Conversation

anatoliykmetyuk
Copy link
Contributor

ctx.source.nextId instead of ctx.base.uniquesSizes does not appear to be tracking the issue in question properly.

println is ugly, but I found that ctx.warning does not flush immediately in that position. When dealing with an issue like #9203, it seems it won't flush at all until the compiler crashes with the OOME. Am I missing something here? Regardless, I think println is fine since this is a best-effort lowest-cost warning for a pathological case that people should not be encountering in first place.

@anatoliykmetyuk anatoliykmetyuk self-assigned this Jun 24, 2020
@anatoliykmetyuk anatoliykmetyuk linked an issue Jun 24, 2020 that may be closed by this pull request
@anatoliykmetyuk anatoliykmetyuk requested a review from smarter June 24, 2020 15:55
@smarter
Copy link
Member

smarter commented Jun 24, 2020

I think if possible we should use as much as possible the same logic (and the same compiler flag) when implicit search produces a lot of tree and when inlining does, but I'll let @nicolasstucki review this and decide.

@smarter smarter assigned nicolasstucki and unassigned smarter Jun 24, 2020
@smarter smarter requested review from nicolasstucki and removed request for smarter June 24, 2020 16:07
@anatoliykmetyuk anatoliykmetyuk force-pushed the space-complexity-tracker branch from df7579f to 969b126 Compare June 25, 2020 11:05
val res = task
val after = size
val delta = after - before
if delta > 100000
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably not be a constant. We should have a setting that allows us to modify this limit. We should probably use XmaxInlinedTrees (and maybe rename it).

val after = size
val delta = after - before
if delta > 100000
println( // ctx.warning does not output the message in this place, probably waits
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not emit an error as we do in Inliner.scala#L132? There we return an errorTree to avoid further expansion, this may also work here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

100 implicits cause OOME
3 participants