-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Remove mixin traits of Context #9343
Conversation
bce1767
to
37e4b27
Compare
test performance please |
performance test scheduled: 1 job(s) in queue, 0 running. |
performance test failed: Please check http://lamppc37.epfl.ch:8000/pull-9343-07-14-22.32.out for more information |
test performance please |
performance test scheduled: 1 job(s) in queue, 0 running. |
From the logs:
|
performance test failed: Please check http://lamppc37.epfl.ch:8000/pull-9343-07-15-10.12.out for more information |
test performance please |
performance test scheduled: 1 job(s) in queue, 0 running. |
Performance test finished successfully: Visit http://dotty-bench.epfl.ch/9343/ to see the changes. Benchmarks is based on merging with master (001817c) |
We seem to have a small but significant improvement of performance in stdlib compilation. The rest is more or less the same. The compiler itself is a little bit slower, which is to be expected since there are now many more implicit searches than before. |
Squashed to one commit to allow for easier rebasing |
c09830d
to
3524a5b
Compare
95b56a8
to
b81cc98
Compare
Stats show that importInfo is updated about 10x less that Store. E.g. compiling Dotty: Total context creations: 5.6M Store creations: 68K Import info creations: 6.8K So this means we save 22.4M be removing importInfo as a field of contexts at a price of less than 600K for the added store creations. # Conflicts: # compiler/src/dotty/tools/dotc/core/Contexts.scala
Use a freelist of unsused contexts instead of overwriting typerstate variables. Rename from `ctx.test` to `explore`.
Also: - Change functions from Context to context functions - Rename ctx.erasedTypes -> currentlyAfterErasure ctx.isAfterTyper -> currentlyAfterTyper - Add currentPhase, currentPeriod, ... utility methods - Replace `c.runId` by `currentRunId(using c)`. This can be changed back again if we end up not splitting period info from contexts - Add inMode, withMode, withoutMode utility wrappers - Move error messages directly into reporting: this avoids an annoying import
- Use only wildcard imports from Contexts - Use `(using Context)` throughout
- `newSymbol`, `requiredSymbol` etc, now are available from Symbols, no `ctx.` prefix needed - All reporing methods are available from `report` object. Also: - Change functions from Context to context functions. - Add atPhase, atPhaseNoLater, addPhaseNoEarlier and have them replace most uss of `withPhase`... - Add inMode, withMode, withoutMode utility wrappers - Move error messages directly into reporting: this avoids an annoying import - Convert old style implicit parameters to `(using Context)` - Reorganize TyperState.test: Instead of overwriting fields of TyperState, keep test contexts in an explicit stack, so that they can be re-used. This is simpler and since there is more decoupling between tests. Usage is now `Contexts.explore(...)` instead of `ctx.test(...)`. # Conflicts: # compiler/src/dotty/tools/dotc/core/Definitions.scala # Conflicts: # compiler/src/dotty/tools/dotc/Run.scala # compiler/src/dotty/tools/dotc/core/Annotations.scala # compiler/src/dotty/tools/dotc/core/Contexts.scala # compiler/src/dotty/tools/dotc/core/Definitions.scala # compiler/src/dotty/tools/dotc/core/Phases.scala # compiler/src/dotty/tools/dotc/core/TyperState.scala # compiler/src/dotty/tools/dotc/core/Types.scala # compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala # compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala # compiler/src/dotty/tools/dotc/transform/TreeChecker.scala # compiler/src/dotty/tools/dotc/typer/Namer.scala
test performance please |
performance test scheduled: 1 job(s) in queue, 0 running. |
Performance test finished successfully: Visit http://dotty-bench.epfl.ch/9343/ to see the changes. Benchmarks is based on merging with master (883198c) |
Fix sbt scripted tests after refactor in #9343
In particular:
newSymbol
,requiredSymbol
etc, now are availablefrom Symbols, no
ctx.
prefix neededreport
object.It's clearer to make them regular objects. Also:
most uss of
withPhase
...an annoying import
(using Context)
contexts in an explicit stack, so that they can be re-used. This is simpler and
since there is more decoupling between tests. Usage is now
Contexts.explore(...)
instead ofctx.test(...)
.