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

Issue #14599: Create performance regression test CI #14754

Merged
merged 1 commit into from May 2, 2024

Conversation

Lmh-java
Copy link
Contributor

@Lmh-java Lmh-java commented Apr 2, 2024

Draft for Issue #14599

Execution Time: 8.50 s
============================================================
===================== BENCHMARK SUMMARY ====================
Average Execution Time: 8.56 s
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This baseline file is generated by the shell script and is parsable by the same shell script. So whenever we want to change the baseline, we can use the same tool to generate this.

@@ -19,7 +19,7 @@
<module name="RegexpOnFilename">
<property name="id" value="executablesLocation"/>
<property name="folderPattern" value="[\\/].ci([\\/]|$)"/>
<property name="fileNamePattern" value="\.(bat|cmd|groovy|sh|md)$"/>
<property name="fileNamePattern" value="\.(bat|cmd|groovy|sh|md|benchmark)$"/>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exclude benchmark files since they must are located in .ci folder but are not executable.

}

# parse baseline benchmark
BASELINE=($(parse_benchmark_result "./.ci/baseline.benchmark"))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may want to read the baseline from the master branch later after this purposal is accepted.

@Lmh-java Lmh-java marked this pull request as ready for review April 2, 2024 21:17
Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Items

.ci/run-benchmark.sh Outdated Show resolved Hide resolved
.ci/baseline.benchmark Outdated Show resolved Hide resolved
.ci/run-benchmark.sh Outdated Show resolved Hide resolved
@Lmh-java Lmh-java requested a review from romani April 4, 2024 04:28
@Lmh-java Lmh-java force-pushed the minghao/new-ci branch 2 times, most recently from d2a87dc to 8e4fd8b Compare April 4, 2024 05:24
Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Items

.ci/check-performance-regression.sh Outdated Show resolved Hide resolved
.ci/check-performance-regression.sh Outdated Show resolved Hide resolved
.ci/check-performance-regression.sh Outdated Show resolved Hide resolved
@Lmh-java Lmh-java force-pushed the minghao/new-ci branch 5 times, most recently from ae85131 to cb8ef90 Compare April 4, 2024 20:30
@Lmh-java
Copy link
Contributor Author

Lmh-java commented Apr 4, 2024

Hi @romani, could you please take a look at the failing CI ci/circleci: no-error-xwiki.
https://app.circleci.com/pipelines/github/checkstyle/checkstyle/25030/workflows/4d5c1a92-68b6-430e-a6d4-cdd4f2716280/jobs/568220

Caused by: java.lang.RuntimeException: Cannot convert '#{env['CI'] == null ? 'ON_DEMAND' : 'ALWAYS'}' to PublishMode, valid values are 'ON_DEMAND', 'ON_FAILURE', 'ALWAYS'
    at com.gradle.maven.common.configuration.q$b.g (SourceFile:582)
    at com.gradle.maven.common.configuration.q$b.lambda$migrateOldPublishElement$8 (SourceFile:532)
    at java.util.Optional.ifPresent (Optional.java:178)

I don't think I've changed anything that is related to this CI failing, and the log doesn't really make sense to me.

Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignore xwiki for now
Good job. Last item:

.github/workflows/check-performance-regression.yml Outdated Show resolved Hide resolved
Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot, ok to merge

Copy link
Member

@nrmancuso nrmancuso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do:

  1. Use SECONDS in all variable names that are time related, I've made some suggestions below.
  2. Use consistent language for execution/run naming, I see no difference between the two in the context of this script.
  3. Show evidence of testing (prove that this will actually fail if we have an execution time that is an outlier). In order to do this, you can make a temporary commit that rebases this PR on the commit before we merged Issue #14566: Improve lexer performance #14568

.ci/check-performance-regression.sh Outdated Show resolved Hide resolved
.ci/check-performance-regression.sh Outdated Show resolved Hide resolved
.ci/check-performance-regression.sh Outdated Show resolved Hide resolved
.ci/check-performance-regression.sh Outdated Show resolved Hide resolved
.ci/check-performance-regression.sh Outdated Show resolved Hide resolved
.ci/check-performance-regression.sh Outdated Show resolved Hide resolved
.ci/check-performance-regression.sh Outdated Show resolved Hide resolved
config/benchmark-config.xml Outdated Show resolved Hide resolved
config/jsoref-spellchecker/whitelist.words Outdated Show resolved Hide resolved
@Lmh-java
Copy link
Contributor Author

Lmh-java commented Apr 17, 2024

Thanks for your response. It might take a little bit longer to apply all these changes than usual. I am having some final exams this week. I am still working on this. Sorry for the delay.

@nrmancuso
Copy link
Member

Thanks for your response. It might take a little bit longer to apply all these changes than usual. I am having some final exams this week. I am still working on this. Sorry for the delay.

No worries :) We are all busy people trying our best. Thanks for your contributions!

@Lmh-java Lmh-java force-pushed the minghao/new-ci branch 4 times, most recently from 4eed542 to 4a66796 Compare April 20, 2024 06:18
@Lmh-java Lmh-java force-pushed the minghao/new-ci branch 14 times, most recently from 2f18758 to e86b762 Compare April 22, 2024 03:21
@Lmh-java
Copy link
Contributor Author

Lmh-java commented Apr 22, 2024

Show evidence of testing (prove that this will actually fail if we have an execution time that is an outlier). In order to do this, you can make a temporary commit that rebases this PR on the commit before we merged #14568

I am working on this right now.

@Lmh-java
Copy link
Contributor Author

Lmh-java commented Apr 22, 2024

@nrmancuso The CI fails in Lmh-java#6 as a test case.

I checkout 3870875 (The commit before #14568), and cherry-picked #14754 for the test.

@Lmh-java Lmh-java requested a review from nrmancuso April 23, 2024 00:29
@Lmh-java
Copy link
Contributor Author

@nrmancuso, by the way, do you think it would be better if we add a line of

    if: github.repository == 'checkstyle/checkstyle'

to this workflow? so that we can make sure it only runs on our end, instead of on the developer ends.

@nrmancuso
Copy link
Member

@nrmancuso, by the way, do you think it would be better if we add a line of

    if: github.repository == 'checkstyle/checkstyle'

to this workflow? so that we can make sure it only runs on our end, instead of on the developer ends.

Yeah, we have done this in most others, I agree.

@Lmh-java
Copy link
Contributor Author

@nrmancuso, by the way, do you think it would be better if we add a line of

    if: github.repository == 'checkstyle/checkstyle'

to this workflow? so that we can make sure it only runs on our end, instead of on the developer ends.

Yeah, we have done this in most others, I agree.

Done

Copy link
Member

@nrmancuso nrmancuso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last from me:

echo "Directory $SAMPLE_PROJECT DOES NOT exist." | exit 1

# add suppressions to config file
sed -i '/ <!-- Filters -->/r ./config/projects-to-test/openjdk17-excluded.files' \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please extract this filename to a variable declared above with SAMPLE_PROJECT, etc., and do anything else to make it easy/obvious to update this script to run on any java version.

@Lmh-java how did we settle on 17, instead of 21?

Copy link
Contributor Author

@Lmh-java Lmh-java May 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please extract this filename to a variable declared above with SAMPLE_PROJECT, etc., and do anything else to make it easy/obvious to update this script to run on any java version.

Sure.

@Lmh-java how did we settle on 17, instead of 21?

I thought JDK 21 has more suppressions for latest syntax, which will consume more time. Since we are measuring the parsing time, this will make the benchmark slightly more inaccurate. So I decided to go with the JDK 17, since it contains relatively more parsable content, and we can avoid extra time consumed by a large amount of suppressions.

This is my reasoning. But if we want to go with JDK 21, it is also totally fine.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am good with 17 for now, just curious about why we did this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am still working on #14779 right now. If that's merged, we can directly use that new property to skip all exceptions. That will be faster than a long list of suppressions :).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@Lmh-java Lmh-java force-pushed the minghao/new-ci branch 2 times, most recently from b3e43f1 to 183bafa Compare May 1, 2024 13:55
Copy link
Member

@nrmancuso nrmancuso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff! Thanks a lot @Lmh-java this will be a big help during syntax updates.

@nrmancuso nrmancuso merged commit d99bd0d into checkstyle:master May 2, 2024
115 checks passed
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 this pull request may close these issues.

None yet

4 participants