typetools / typetools/checker-framework
Too long compilation
@wmdietl is already working on this.
Since Mar 13, 2018.
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 440
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 134
Description
Hello.
In our project we use java code generators which produce classes with hundreds of fields.
Consider synthetic example:
public class Test3 {
private final Random fld0 = new Random();
private final Random fld1 = new Random();
private final Random fld2 = new Random();
public int count(){
int result = 0;
result += fld0.nextInt();
result += fld1.nextInt();
result += fld2.nextInt();
return result;
}
}
I measured compilation time depends on fields count:
100.00 | 1.20
200.00 | 2.60
300.00 | 4.70
400.00 | 8.50
500.00 | 13.30
600.00 | 15.60
700.00 | 22.70
800.00 | 28.60
900.00 | 37.60
1000.00 | 44.60
for 2000 field compilation time was 200 sec with peak memory consumption 8 GB!!!
without CF compilation time was 3 sec.
We need to enable CF for hand-written code.
We generate code in annotation processors. So hand-written and auto-generated code are in the very same module.
If it is not possible to speedup compilation may be it would be a good idea to have possibility to disable CF for some classes in module?
For ex, @SuppressWarning("nullness") on a class should prevent CF to analyze methods' bodies.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.