Skip to content

Conversation

@JeffBezanson
Copy link
Member

Use a table to avoid each symbol lookup being O(n) in the scope nesting depth.

Usually scopes are not nested too deep, but our let is actually let*, so each variable also introduces a new scope, so long lists of let-bound variables can be a problem.

@JeffBezanson JeffBezanson added performance Must go faster compiler:lowering Syntax lowering (compiler front end, 2nd stage) latency Latency and removed performance Must go faster labels Nov 10, 2021
@Keno Keno added the needs tests Unit tests are required for this change label Nov 10, 2021
@oscardssmith
Copy link
Member

@Keno what type of tests do you want? Tests that the result is correct, or that the performance is good?

@Keno
Copy link
Member

Keno commented Nov 10, 2021

Tests that the performance is reasonable would be good.

@oscardssmith
Copy link
Member

Given that this is "only" a quadratic speedup, that test seems like it will be kind of brittle... Did you have something in mind?

@Keno
Copy link
Member

Keno commented Nov 10, 2021

If we can't reliably separate the fixed and broken cases using timing, I guess putting it on nanosolider would be reasonable.

Use a table to avoid each symbol lookup being O(n) in the scope nesting depth.
@JeffBezanson JeffBezanson force-pushed the jb/faster-resolve-scopes branch from 0942542 to 4545fd2 Compare November 16, 2021 22:31
@oscardssmith
Copy link
Member

Is this good to merge now that we have a benchmark PR?

vtjnash pushed a commit to JuliaCI/BaseBenchmarks.jl that referenced this pull request Nov 16, 2021
@JeffBezanson JeffBezanson merged commit 22a192c into master Nov 19, 2021
@JeffBezanson JeffBezanson deleted the jb/faster-resolve-scopes branch November 19, 2021 20:50
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Feb 22, 2022
Use a table to avoid each symbol lookup being O(n) in the scope nesting depth.
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Mar 8, 2022
Use a table to avoid each symbol lookup being O(n) in the scope nesting depth.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compiler:lowering Syntax lowering (compiler front end, 2nd stage) latency Latency needs tests Unit tests are required for this change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants