Skip to content
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

WIP: Experiment with 2-phase compilation with outline and batch parallel compile #19589

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

bishabosha
Copy link
Member

This builds on the pipelining support in #18880 to implement outline compile for first pass, and batched parallel for second pass. Also based on work originally by @smarter in #4767

The work in this PR has been demonstrated at various meetups/conferences - London Scala User's Group, Paris Scala User Group, and Scala Italy

adds -Yexperimental-outline, -Ysecond-pass and -Ymax-parallelism flags

@bishabosha bishabosha self-assigned this Feb 1, 2024
the method was never used, and not well defined, e.g. with branches
to search in both tasty files and class files, which could be
severely inefficient.
This caches common file extensions, while still being extensible.
Also fixes many operations with unexpected behavior (manipulation of
file extensions where toLowerCase behaves differently with certain locales.)
For pipelining Zinc needs to know about non-local classes early.
e.g. it enables Zinc to disable pipelining if a non-local class
contains macros.

The changes in this commit are based of changes made originally in Zinc:
sbt/zinc@856d416
- rename '-Yjava-tasty-output' to '-Yearly-tasty-output' because
  now Scala TASTy will also be written to this destination.
- add '-Ypickle-java' alias of '-Yjava-tasty', as expected by Zinc
- add '-Ypickle-write' alias of '-Yearly-tasty-output', as expected by Zinc
- move ExtractAPI phase to after Pickler, this way we can do it in
  parallel with generating TASTy bytes. At the end of this phase we
  write the TASTy to the '-Yearly-tasty-output' destination.
  Also ensure that ExtractAPI phase runs with '-Yjava-tasty', even if no
  incremental callback is set (don't extract the API in this case).
- test the pipelining with sbt scripted tests, including for inline
  methods and macros with pipelining
- describe semantics with respect to suspensions,
  introduce -Yno-suspended-units flag for greater control by the user.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant