-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Unpickle quotes with the destination context #4242
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
Conversation
This avoids exponential traversal of the tree due to owner changes of the dummy valdefs for the contents of quote.
Alternative fix for issue tackled in #4238. This version does not need any owner change after unpickling. |
test performance please |
performance test scheduled: 113 job(s) in queue, 1 running. |
Performance test finished successfully: Visit http://dotty-bench.epfl.ch/4242/ to see the changes. Benchmarks is based on merging with master (4c8a2bd) |
See last benchmark of http://dotty-bench.epfl.ch/4242/ |
test performance with #quotes please |
performance test scheduled: 1 job(s) in queue, 0 running. |
Performance test finished successfully with some manual help (due to benchmark refactoring): Visit http://dotty-bench.epfl.ch/4242/ to see the changes. |
test performance with #quotes please |
performance test scheduled: 1 job(s) in queue, 0 running. |
Performance test finished successfully: Visit http://dotty-bench.epfl.ch/4242/ to see the changes. Benchmarks is based on merging with master (c8030ef) |
@smarter don't forget to review this PR |
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.
LGTM, but this is starting to be pretty hacky, I think it'd be nicer to just pickle the quoted tree without wrapping it in a ValDef, that requires some changes to how pickling works, but that's not a big deal.
@@ -59,7 +59,10 @@ object PickledQuotes { | |||
val unpickled = unpickle(tastyBytes, expr.args) | |||
unpickled match { | |||
case PackageDef(_, (vdef: ValDef) :: Nil) => | |||
vdef.rhs.changeOwner(vdef.symbol, ctx.owner) | |||
// vdef.rhs was unpickled with the current context. Symbols in vdef.rhs with | |||
// owner vdef.symbol are unpickled as if their owner was ctx.owner. This optimization |
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.
Would be good to give the name of the method that does this in TreeUnpickler.
I will explore the possibility of pickling the tree directly in tasty. |
This avoids exponential traversal of the tree due to owner changes
of the dummy valdefs for the contents of quote.