INRIA / INRIA/spoon

Spoon Maven Plugin is extremely slow with generated Protobuffer-Classes

Open
#2,893 4 comments 0 reactions 0 assignees View on GitHub
performance
Dominant language
Java
Stars
2k
Forks
392
Avg merge
11h 24m
Merged PRs (30d)
36

Description

Hi,
I'm trying to incorporate Spoon into my project to modify generated Protobuffer-Classes.
However when running `mvn install` on my project with the spoon-plugin enabled, it freezes when running the `JavaOutputProcessor`.
After trying to reproduce this in a clean test-project I found out that spoon seems to get really slow when analyzing protoc-generated java-classes. So slow that it didn't finish on my main-project when running it for around half an hour.
I created and attached a simple test-project for you guys to reproduce this. It contains 9 proto-messages that the `protobuf-maven-plugin` will generate java-code for. After that the spoon-plugin will run without any processor configured and needs 1.5minutes to finish on my local machine.
Disclaimer: The generated Proto-class is around 3000 lines big. Is this the problem? Is there a way to speed up the process? I just want to remove the "final"-attribute from all "Builder"-classes.

Guide on how to reproduce:
1. download and unpack the [zip-file](https://github.com/INRIA/spoon/files/2905062/SpoonProtoTest.zip)
2. install the protoc-binary to compile proto-files
- for example [here](https://developers.google.com/protocol-buffers/docs/downloads) or via `brew install protobuf`
3. run `mvn clean install` on the project

What I see:
```
[INFO] --- spoon-maven-plugin:3.1:generate (default) @ SpoonProtoTest ---
2019-02-26 11:49:26,788 WARN spoon.Launcher - Spoon is now using the 'no classpath mode' by default. If you want to ensure using Spoon in full classpath mode, please use the new flag: --cpmode fullclasspath.
2019-02-26 11:49:26,789 WARN spoon.Launcher - Spoon now parse by default the comments. Consider using the option --disable-comments if you want the old behaviour.
2019-02-26 11:49:26,794 INFO spoon.Launcher - Spoon version 7.0.0
2019-02-26 11:49:26,794 INFO spoon.Launcher - running Spoon...
2019-02-26 11:49:26,794 INFO spoon.Launcher - start processing...
2019-02-26 11:49:28,433 INFO spoon.Launcher - spoon.support.JavaOutputProcessor
2019-02-26 11:51:07,720 INFO spoon.Launcher - end of processing:
2019-02-26 11:51:07,720 INFO spoon.Launcher - no errors, no warnings
```

Is this a performance-leak or am I just misusing the library?
Thanks :)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.