-
Notifications
You must be signed in to change notification settings - Fork 90
Performance improvements to the macro #198
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Introduce a per-Global store of names - Avoid double freshening names - Use $async$ in all names to avoid clashes with, e.g. lambda lifted methods.
If we're in the expr position of a block, the nested state generation can reuse the successor state. Also, output .dot graph of state machine in verbose mode. Sample: https://gist.github.com/88225478b11c118609b9348d61e13630 View with a local Graphviz install or http://graphviz.it/#/gallery/unix.gv Sample generated from late expansion of: val result = run( """ import scala.async.run.late.{autoawait,lateasync} case class FixedFoo(foo: Int) class Foobar(val foo: Int, val bar: Double) { def guard: Boolean = true @autoawait @lateasync def getValue = 4.2 @autoawait @lateasync def func(f: Any) = { ("": Any) match { case (x1, y1) if guard => x1.toString; y1.toString case (x2, y2) if guard => x2.toString; y2.toString case (x3, y3) if guard => x3.toString; y3.toString case (x4, y4) => getValue; x4.toString; y4.toString } } } object Test { @lateasync def test() = new Foobar(0, 0).func(4) } """)
TODO:
|
I've improved the .dot output.
Updated sample: https://gist.github.com/bbd3312404a9259e4c0f0135bf5d34e3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Avoid boxing
Don't box state IDs in collections.
Avoid needless string to name conversion
Rework dead state elimination to happen as part of expr builder
If we're in the expr position of a block, the nested state
generation can reuse the successor state.
Also, output .dot graph of state machine in verbose mode.
Sample: https://gist.github.com/88225478b11c118609b9348d61e13630
View with a local Graphviz install or http://graphviz.it/#/gallery/unix.gv
Sample generated from late expansion of: