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

Using JavaFileObject.openOutputStream is very slow #233

Open
oehme opened this issue Oct 28, 2020 · 0 comments
Open

Using JavaFileObject.openOutputStream is very slow #233

oehme opened this issue Oct 28, 2020 · 0 comments

Comments

@oehme
Copy link

oehme commented Oct 28, 2020

This method returns an output stream that writes each byte individually, which makes builds very slow. This Javac bug exists all the way up to JDK 15. The FilerOutputStream extends FilterOutputStream without overriding the write(byte[], offset, length) method. I've opened a JDK bug.

In the meantime you can use JavaFileObject.openWriter instead, which does not have this performance problem. You can adapt it back to OutputStream using org.apache.commons.io.output.WriterOutputStream

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

No branches or pull requests

1 participant