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

Serious performance degradation #4948

Closed
MichalStehlikCz opened this issue Nov 4, 2021 · 1 comment · Fixed by #4957
Closed

Serious performance degradation #4948

MichalStehlikCz opened this issue Nov 4, 2021 · 1 comment · Fixed by #4957
Assignees

Comments

@MichalStehlikCz
Copy link
Contributor

MichalStehlikCz commented Nov 4, 2021

After updating CheckerFramework from 3.18.1 to 3.19.0, we observed serious performance degradation and have to fall back to 3.18.1.

Sample file to demonstrate problem is


public class SpeedTest {

  static Stream<@Nullable Object[]> parseTest() {
    return Stream.of(
        new @Nullable Object[]{"12:15:24", 125}
        , new @Nullable Object[]{"3:27", 5456}
        , new @Nullable Object[]{"-1:15:4:00", 54665453}
        , new @Nullable Object[]{"124:7:56:00", 45}
        , new @Nullable Object[]{"10", null}
        , new @Nullable Object[]{"10:74:00:00", null}
        , new @Nullable Object[]{"10:00:60:00", null}
        , new @Nullable Object[]{"10:00:00:05", null}
        , new @Nullable Object[]{"12#15:24", null}
        , new @Nullable Object[]{"12:15#24", null}
        , new @Nullable Object[]{"12:15:24#10", null}
        , new @Nullable Object[]{"x12:15:24", null}
        , new @Nullable Object[]{"12:15:24x", null}
        , new @Nullable Object[]{"12:15:24x", null}
        , new @Nullable Object[]{"12:15:24x", null}
        , new @Nullable Object[]{"12:15:24x", null}
        , new @Nullable Object[]{"12:15:24x", null}
        , new @Nullable Object[]{"12:15:24x", null}
        , new @Nullable Object[]{"12:15:24x", null}
        , new @Nullable Object[]{"12:15:24x", null}
        , new @Nullable Object[]{"12:15:24x", null}
        , new @Nullable Object[]{"12:15:24x", null}
        , new @Nullable Object[]{"12:15:24x", null}
        , new @Nullable Object[]{"12:15:24x", null}
        , new @Nullable Object[]{"12:15:24x", null}
        , new @Nullable Object[]{"12:15:24x", null}
        , new @Nullable Object[]{"12:15:24x", null}
        , new @Nullable Object[]{"12:15:24x", null}
        , new @Nullable Object[]{"12:15:24x", null}
        , new @Nullable Object[]{"12:15:24x", null}
        , new @Nullable Object[]{"12:15:24x", null}
        , new @Nullable Object[]{"12:15:24x", null}
        , new @Nullable Object[]{"12:15:24x", null}
        , new @Nullable Object[]{"12:15:24x", null}
        , new @Nullable Object[]{"12:15:24x", null}
        , new @Nullable Object[]{"12:15:24x", null}
        , new @Nullable Object[]{"12:15:24x", null}
        , new @Nullable Object[]{"12:15:24x", null}
        , new @Nullable Object[]{"12:15:24x", null}
        , new @Nullable Object[]{"12:15:24x", null}
        , new @Nullable Object[]{"12:15:24x", null}
        , new @Nullable Object[]{"12:15:24x", null}
        , new @Nullable Object[]{"12:15:24x", null}
        , new @Nullable Object[]{"12:15:24x", null}
        , new @Nullable Object[]{"12:15:24x", null}
        , new @Nullable Object[]{"12:15:24x", null}
        , new @Nullable Object[]{"12:15:24x", null}
        , new @Nullable Object[]{"12:15:24x", null}
        , new @Nullable Object[]{"12:15:24x", null}
        , new @Nullable Object[]{"#####", -2}
        , new @Nullable Object[]{"*****", -1}
        , new @Nullable Object[]{"<<<<<", Integer.MIN_VALUE}
        , new @Nullable Object[]{">>>>>", Integer.MAX_VALUE}
    );
  }
}

Compiled on JDK11, pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.provys</groupId>
  <artifactId>speed</artifactId>
  <version>1.0-SNAPSHOT</version>
  <properties>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</maven.compiler.target>
  </properties>
  <dependencies>
    <dependency>
      <groupId>org.checkerframework</groupId>
      <artifactId>checker-qual</artifactId>
      <version>3.19.0</version>
    </dependency>
  </dependencies>
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.8.1</version>
          <configuration>
            <release>11</release>
            <showWarnings>true</showWarnings>
            <compilerArguments>
              <Xmaxerrs>10000</Xmaxerrs>
              <Xmaxwarns>10000</Xmaxwarns>
            </compilerArguments>
            <annotationProcessorPaths>
              <path>
                <groupId>org.checkerframework</groupId>
                <artifactId>checker-qual</artifactId>
                <version>3.18.1</version>
              </path>
              <path>
                <groupId>org.checkerframework</groupId>
                <artifactId>checker</artifactId>
                <version>3.18.1</version>
              </path>
            </annotationProcessorPaths>
            <annotationProcessors>
              <annotationProcessor>org.checkerframework.checker.nullness.NullnessChecker
              </annotationProcessor>
            </annotationProcessors>
            <fork>true</fork>
            <compilerArgs>
              <arg>-parameters</arg>
              <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
              <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
              <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>
              <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg>
              <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg>
              <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg>
              <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
              <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg>
              <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
              <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
              <arg>-Werror</arg>
              <arg>-Xlint:all,-processing,-serial,-path</arg>
              <arg>-XDcompilePolicy=simple</arg>
              <arg>-AskipUses=^org[.]assertj[.]</arg>
            </compilerArgs>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
</project>

Using checkerframework 3.18.1, total build time is 3.1 seconds; using checkerframework 3.19.0, build time goes to 9.3 seconds.

@smillst smillst self-assigned this Nov 4, 2021
@smillst
Copy link
Member

smillst commented Nov 4, 2021

Thanks for reporting! We changed the way annotations for array initializers are computed, so it must be related to that change. I'll look into.

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 a pull request may close this issue.

2 participants