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

REVIEW add support for incremental build #1905

Merged
merged 5 commits into from
Jun 13, 2018

Conversation

Egor18
Copy link
Contributor

@Egor18 Egor18 commented Mar 10, 2018

Moved from #1816

Hi, this is my new implementation of the incremental build.

A few words about performance.
On my machine spoon model for RxJava project builds in about 15 minutes, but I can get cached model in less than 1 minute. So, on some projects cache itself could be quite useful.
I added BufferedOutputStream and BufferedInputStream to SerializationModelStreamer because they drastically increase model serialization/deserialization speed (dozens of times or even more).
However, it's possible that reference resolution part for incremental build could be rewritten in a more effective way (as I mentioned here).

So what do you think about this incremental launcher?

@Egor18 Egor18 mentioned this pull request Mar 10, 2018
@@ -75,7 +75,7 @@

public static final String OUTPUTDIR = "spooned";

private final Factory factory;
protected Factory factory;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it really necessary to make the factory protected?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can replace that with super(oldFactory), but I would like to avoid undesirable call of processArguments() in the Launcher constructor. Alternatively, I can add another protected constructor to the Launcher, which does not call processArguments().

@surli
Copy link
Collaborator

surli commented Mar 13, 2018

I'm not really sure why you created a new Launcher for that feature: why not creating a class managing the serialization that you can use in the current Launcher if a specific option is given? And maybe adding a new property in environment to manage the cache directory.

My point is your new IncrementalLauncher is breaking the current behaviour of Launcher: what if I create an IncrementalLauncher and add resources in the environment after it?

@monperrus
Copy link
Collaborator

Before adding new code, could you, in a first PR, remove the code related to the old and broken 'build-outdated' feature? Thanks!

@monperrus monperrus changed the title Incremental build add support for incremental build Mar 16, 2018
@Egor18
Copy link
Contributor Author

Egor18 commented Mar 19, 2018

@surli Ok, so what API do you suggest?
Something like that?

Launcher launcher = new Launcher();
launcher.addInputResources(....);
launcher.getEnvironment.setClasspath(....);
launcher.getEnvironment().setCacheEnabled(true);
launcher.getEnvironment().setCacheDir(....);
launcher.setIncremental(true);
launcher.build();

I think, I can refactor it this way.

@surli
Copy link
Collaborator

surli commented Mar 19, 2018

Actually you could even put the setIncremental inside the environment: we might need this value in other classes for specific treatments.

And isn't the cache directory mandatory in case of incremental build?

So I suggest this kind of API then:

Launcher launcher = new Launcher();
launcher.addInputResources(....);
launcher.getEnvironment.setClasspath(....);
launcher.getEnvironment().setIncremental(true);
launcher.getEnvironment().setCacheDir(....); // optional: a default value should be available
launcher.build();

WDYT?

@Egor18
Copy link
Contributor Author

Egor18 commented Mar 19, 2018

Ok. I'll try to implement this API.

@surli surli changed the title add support for incremental build WIP add support for incremental build Mar 26, 2018
@surli
Copy link
Collaborator

surli commented Mar 26, 2018

Any news on this one @Egor18 ?

@Egor18
Copy link
Contributor Author

Egor18 commented Mar 27, 2018

@surli I'll do that as soon, as I can.

@mehdi-kaytoue
Copy link
Contributor

Any news? I am very interested in this feature, it looks quite related to #1983

Would be happy to help

Cheers,
Mehdi

@monperrus monperrus changed the title WIP add support for incremental build Review: add support for incremental build Jun 13, 2018
@monperrus monperrus changed the title Review: add support for incremental build WIP? add support for incremental build Jun 13, 2018
@monperrus
Copy link
Collaborator

just restarted Travis

@monperrus monperrus merged commit b6a8d6b into INRIA:master Jun 13, 2018
@monperrus
Copy link
Collaborator

Thanks a lot for the contribution!

@monperrus monperrus changed the title WIP? add support for incremental build REVIEW add support for incremental build Jun 13, 2018
@surli surli mentioned this pull request Jun 25, 2018
@Egor18 Egor18 deleted the incremental_build_2 branch October 5, 2018 09:30
@Egor18 Egor18 restored the incremental_build_2 branch October 5, 2018 09:31
@Egor18 Egor18 deleted the incremental_build_2 branch October 5, 2018 09:32
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.

5 participants