|
402 | 402 | \subsectionAndLabel{Will using the Checker Framework slow down my program? Will it slow down the compiler?}{faq-slowdown}
|
403 | 403 |
|
404 | 404 | Using the Checker Framework has no impact on the execution of your program:
|
405 |
| -the compiler emits the identical bytecodes as the javac |
406 |
| -compiler and so there is no run-time effect. Because there is no run-time |
| 405 | +the javac compiler emits identical bytecodes whether or not the Checker |
| 406 | +Framework is used, so there is no run-time effect. Because there is no run-time |
407 | 407 | representation of type qualifiers, there is no way to use reflection to
|
408 | 408 | query the qualifier on a given object, though you can use reflection to
|
409 | 409 | examine a class/method/field declaration.
|
|
1816 | 1816 | limit is so small that the Checker Framework might spend most of its time
|
1817 | 1817 | in garbage collection. (If this is the case, the Checker Framework will
|
1818 | 1818 | issue a warning ``Garbage collection consumed over 25\% of CPU during the
|
1819 |
| - past minute.") For example, you might pass an argument like |
1820 |
| - \<-Xmx3g>, or set an environment variable like \<export |
1821 |
| - \_JAVA\_OPTIONS=-Xmx3g>, to permit the Checker Framework to use up to 3GB |
1822 |
| - of memory. If you use Java 8, consider upgrading to Java 11 or Java 17, which have |
1823 |
| - better memory management. |
| 1819 | + past minute.") To permit the Checker Framework to use up to 3GB of |
| 1820 | + memory, pass an argument like \<-Xmx3g> or set an environment variable |
| 1821 | + like \<export \_JAVA\_OPTIONS=-Xmx3g>. Also consider upgrading to a more |
| 1822 | + recent release of Java, because older versions of Java (especially 8 and |
| 1823 | + 11, but also 17) have worse memory management. |
1824 | 1824 | \item
|
1825 | 1825 | Set your build system to perform \emph{incremental compilation}. When
|
1826 | 1826 | compiling just a few source files (the size of a typical edit or commit),
|
|
1832 | 1832 | uses Maven, consider switching to a more capable build system such as Gradle.)
|
1833 | 1833 | % (Note that some build systems have a bug, in that they unnecessarily always
|
1834 | 1834 | % re-run compilation that uses annotation processors.)
|
| 1835 | +\item |
| 1836 | + Write generic type arguments. Often, generic type inference is the |
| 1837 | + slowest part of type-checking. You can significantly speed up |
| 1838 | + type-checking by explicitly writing a few generic type arguments. To |
| 1839 | + determine where to write them, temporarily set |
| 1840 | + \<-AslowTypecheckingSeconds> to a small value, such as 1. Write type |
| 1841 | + arguments where \<slow.typechecking> warnings are issued. |
1835 | 1842 | \end{itemize}
|
1836 | 1843 |
|
1837 | 1844 | If the Checker Framework is still too slow for you to run on every compilation,
|
|
0 commit comments