Skip to content

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

Closed

Conversation

nicolasstucki
Copy link
Contributor

This avoids exponential traversal of the tree due to owner changes
of the dummy valdefs for the contents of quote.

This avoids exponential traversal of the tree due to owner changes
of the dummy valdefs for the contents of quote.
@nicolasstucki
Copy link
Contributor Author

Alternative fix for issue tackled in #4238. This version does not need any owner change after unpickling.

@nicolasstucki
Copy link
Contributor Author

test performance please

@dottybot
Copy link
Member

dottybot commented Apr 4, 2018

performance test scheduled: 113 job(s) in queue, 1 running.

@dottybot
Copy link
Member

dottybot commented Apr 4, 2018

Performance test finished successfully:

Visit http://dotty-bench.epfl.ch/4242/ to see the changes.

Benchmarks is based on merging with master (4c8a2bd)

@nicolasstucki
Copy link
Contributor Author

See last benchmark of http://dotty-bench.epfl.ch/4242/

@nicolasstucki
Copy link
Contributor Author

test performance with #quotes please

@dottybot
Copy link
Member

performance test scheduled: 1 job(s) in queue, 0 running.

@liufengyun
Copy link
Contributor

Performance test finished successfully with some manual help (due to benchmark refactoring):

Visit http://dotty-bench.epfl.ch/4242/ to see the changes.

@nicolasstucki
Copy link
Contributor Author

test performance with #quotes please

@dottybot
Copy link
Member

performance test scheduled: 1 job(s) in queue, 0 running.

@dottybot
Copy link
Member

Performance test finished successfully:

Visit http://dotty-bench.epfl.ch/4242/ to see the changes.

Benchmarks is based on merging with master (c8030ef)

@nicolasstucki
Copy link
Contributor Author

nicolasstucki commented May 7, 2018

@smarter don't forget to review this PR

Copy link
Member

@smarter smarter left a 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
Copy link
Member

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.

@nicolasstucki
Copy link
Contributor Author

I will explore the possibility of pickling the tree directly in tasty.

@nicolasstucki
Copy link
Contributor Author

As suggested by @smarter we will instead pickle the expression directly in the tasty (no encapsulation). See #4538.

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

Successfully merging this pull request may close these issues.

5 participants