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

[performance] Avoid reading SourceFile twice #2910

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jukzi
Copy link
Contributor

@jukzi jukzi commented Sep 4, 2024

During compile parsing happens in two stages:

  1. diet parse (any blocks like method bodies are skipped)
  2. parse bodies Both phases did read the source .java file from file system. With this change the file contents is kept until no longer needed. It is cached in a SoftReference to avoid OutOfMemoryError.

#2691

@jukzi jukzi linked an issue Sep 4, 2024 that may be closed by this pull request
@jukzi jukzi force-pushed the SourceFile branch 2 times, most recently from 87e11f3 to e2f4ffc Compare September 5, 2024 08:47
During compile parsing happens in two stages:
1. diet parse (any blocks like method bodies are skipped)
2. parse bodies
Both phases did read the source .java file from file system. With this
change the file contents is kept until no longer needed. It is cached in
a SoftReference to avoid OutOfMemoryError.

eclipse-jdt#2691
@jukzi
Copy link
Contributor Author

jukzi commented Sep 9, 2024

@stephan-herrmann could you review, please?
On my computer building the whole platform workspace it reduces reading sources from 7 to 3.5 seconds - which is expected (halfling that time)

@stephan-herrmann
Copy link
Contributor

@stephan-herrmann could you review, please? On my computer building the whole platform workspace it reduces reading sources from 7 to 3.5 seconds - which is expected (halfling that time)

My focus is still on shipping complete support for Java 23. Any other reviews will have to wait until after 17 Sept.

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.

Clean build: SourceFile(s) read twice
3 participants