-
Notifications
You must be signed in to change notification settings - Fork 11
Improve the performance of the server #118
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
Comments
Hi @Arthurm1, let's continue the perf discussion here. I can add some background why The reason to do that is because some gradle plugin may generate source code into a specific folder that is unknown by using the api of Query the sourceset again after compilation makes sure that this kind of generated code will be discovered automatically, though maybe it could be too 'heavy'. |
Does that require compilation though? If I setup a gradle project with... plugins {
id 'java'
id 'java-gradle-plugin'
id "com.google.protobuf" version "0.9.4"
} The |
One way to shift the protobuf dir from srcDirs into the generated dirs might be... private void moveProtobufGeneratedSourceDirs(Project project,
Set<File> srcDirs, Set<File> generatedSrcDirs) {
Object protobufPlugin = project.getExtensions().findByName("protobuf");
if (protobufPlugin != null) {
try {
Method getGeneratedFilesBaseDirMethod = protobufPlugin.getClass().getMethod("getGeneratedFilesBaseDir");
Object baseDirObj = getGeneratedFilesBaseDirMethod.invoke(protobufPlugin);
if (baseDirObj instanceof String) {
Path basePath = new File((String) baseDirObj).toPath();
// does the source dir start with the Protobuf Base dir
// if so, shift it from srcDirs to generatedSrcDirs
Set<File> dirsToMove = srcDirs.stream().filter(src -> src.toPath().startsWith(basePath)).collect(Collectors.toSet());
srcDirs.removeIf(src -> dirsToMove.contains(src));
generatedSrcDirs.addAll(dirsToMove);
}
} catch (NoSuchMethodException | SecurityException | IllegalAccessException
| IllegalArgumentException | InvocationTargetException e) {
// ignore
}
}
} |
They changed their implementation. If I remember correctly, versions below 0.9 (0.8.x) won't append the generate output folder into sources.
I've considered that as well, but finally gave up this approach. Because it tightly binds the implementation of protobuff plugin. And cannot handle other kinds of code generation plugins which use same approaches. |
This remains quite slow. Often taking an hour when loading a large project. Any updates? |
The discussion was originally raised at #113 (comment)
The text was updated successfully, but these errors were encountered: