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

fix: pre-compile visitable classes regex pattern #17280

Merged
merged 1 commit into from
Jul 25, 2023

Conversation

mcollovati
Copy link
Collaborator

Description

Pre compiles the regex pattern to improve build frontend performance during the bytecode scan and collection of reachable classes. Also adds some package exclusions for well knonw libraries that should not be visited.

Part of #17234

Type of change

  • Bugfix
  • Feature

Checklist

  • I have read the contribution guide: https://vaadin.com/docs/latest/guide/contributing/overview/
  • I have added a description following the guideline.
  • The issue is created in the corresponding repository and I have referenced it.
  • I have added tests to ensure my change is effective and works as intended.
  • New and existing tests are passing locally with my change.
  • I have performed self-review and corrected misspellings.

Additional for Feature type of change

  • Enhancement / new feature was discussed in a corresponding GitHub issue and Acceptance Criteria were created.

Pre compiles the regex pattern to improve build frontend performance
during the bytecode scan and collection of reachable classes.
Also adds some package exclusions for well knonw libraries that should
not be visited.

Part of #17234
@sonatype-lift
Copy link

sonatype-lift bot commented Jul 25, 2023

Sonatype Lift is retiring

Sonatype Lift will be retiring on Sep 12, 2023, with its analysis stopping on Aug 12, 2023. We understand that this news may come as a disappointment, and Sonatype is committed to helping you transition off it seamlessly. If you’d like to retain your data, please export your issues from the web console.
We are extremely grateful and thank you for your support over the years.

📖 Read about the impacts and timeline

@mcollovati
Copy link
Collaborator Author

Comparison between 24.1.3 and the snapshot from this PR, on a simple project with 400 routes

8:17:37.387 [INFO] --- vaadin-maven-plugin:24.1.3:build-frontend (default) @ spring-skeleton ---
08:17:37.723 [INFO] Reflections took 292 ms to scan 127 urls, producing 4866 keys and 25879 values
08:17:37.743 [INFO] Scanning classes to find frontend configurations and dependencies...
08:17:46.729 [INFO] Visited 1377 classes. Took 8985 ms.
08:20:59.760 [INFO] --- flow-maven-plugin:24.2-SNAPSHOT:build-frontend (default) @ spring-skeleton ---
08:20:59.963 [INFO] Reflections took 196 ms to scan 127 urls, producing 4866 keys and 25880 values
08:20:59.969 [INFO] Scanning classes to find frontend configurations and dependencies...
08:21:02.292 [INFO] Visited 1370 classes. Took 2322 ms.

@sonarcloud
Copy link

sonarcloud bot commented Jul 25, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@github-actions
Copy link

Test Results

1 000 files  ±  0  1 000 suites  ±0   1h 2m 44s ⏱️ - 2m 44s
6 364 tests ±  0  6 323 ✔️ ±  0  41 💤 ±0  0 ±0 
6 623 runs  +10  6 575 ✔️ +10  48 💤 ±0  0 ±0 

Results for commit b85c633. ± Comparison against base commit 86a01c6.

@mcollovati mcollovati merged commit 96bb948 into main Jul 25, 2023
@mcollovati mcollovati deleted the issues/17234_build_frontend_improvements branch July 25, 2023 07:31
vaadin-bot pushed a commit that referenced this pull request Jul 25, 2023
Pre compiles the regex pattern to improve build frontend performance
during the bytecode scan and collection of reachable classes.
Also adds some package exclusions for well knonw libraries that should
not be visited.

Part of #17234
@vaadin-bot
Copy link
Collaborator

Hi @mcollovati and @mcollovati, when i performed cherry-pick to this commit to 24.0, i have encountered the following issue. Can you take a look and pick it manually?
Error Message:
Error: Command failed: git cherry-pick 96bb948
error: could not apply 96bb948... fix: pre-compile visitable classes regex pattern (#17280)
hint: After resolving the conflicts, mark them with
hint: "git add/rm ", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

vaadin-bot added a commit that referenced this pull request Jul 25, 2023
Pre compiles the regex pattern to improve build frontend performance
during the bytecode scan and collection of reachable classes.
Also adds some package exclusions for well knonw libraries that should
not be visited.

Part of #17234

Co-authored-by: Marco Collovati <marco@vaadin.com>
mcollovati added a commit that referenced this pull request Jul 25, 2023
Pre compiles the regex pattern to improve build frontend performance
during the bytecode scan and collection of reachable classes.
Also adds some package exclusions for well knonw libraries that should
not be visited.

Part of #17234
mcollovati added a commit that referenced this pull request Jul 25, 2023
Pre compiles the regex pattern to improve build frontend performance
during the bytecode scan and collection of reachable classes.
Also adds some package exclusions for well knonw libraries that should
not be visited.

Part of #17234
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 24.2.0.alpha5 and is also targeting the upcoming stable 24.2.0 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants