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

ComponentTracker is very slow #18130

Closed
Freeman656 opened this issue Nov 24, 2023 · 4 comments · Fixed by #18355
Closed

ComponentTracker is very slow #18130

Freeman656 opened this issue Nov 24, 2023 · 4 comments · Fixed by #18355

Comments

@Freeman656
Copy link

Description of the bug

When using Vaadin > 24 is dev mode, the ComponentTracker is very slow which make the whole application very slow.

This is annoying most of the time for very low reward (knowing where the component has been created/attached is helpful just a few times during development).
This is also very noticable when using JProfiler because the recording streches up all superficial calls (see attachment)

image

Expected behavior

The most practical way I see it is by adding a property to avoid the tracking, in addition to the productionMode.
This would solve the performance issue if needed by the developer, and would also still allow other to continue the tracking.

Minimal reproducible example

The best way is to create a page with ~100 select containing each ~1000 elements with custom renderer (this is not my case but this would trigger the performance issue)

Versions

  • Vaadin / Flow version: 24.2.3
  • Java version: 21.0.1
@mcollovati
Copy link
Collaborator

I tried locally with 100 selects with 1000 items and component renderer as suggested.
Page rendering is, of course, slow, but for me, the time consumed by ComponenTracker is irrilevent (less than 1 millisecond per each call).
Also disabling the ComponenTracker, I can't see relevant differences in page load

@mcollovati
Copy link
Collaborator

Anyway, it should be safe to add a configuration property to disable ComponentTracker in dev mode

@Freeman656
Copy link
Author

Thanks for your investigation. As you mentionned it's taking less than an ms for each call but called 100k times, it's starting to feel like 10 to 60 seconds for the page to load, when compared with the production mode which is around 2 to 3s.
I agree on the configuration property, it's safe to do and doesn't require heavy modifications...

@mcollovati mcollovati self-assigned this Dec 22, 2023
mcollovati added a commit that referenced this issue Dec 22, 2023
Adds a configuration parameter that allows developers to
disable component tracking.

Fixes #18130
mcollovati added a commit to vaadin/docs that referenced this issue Dec 22, 2023
Vaadin Flow enhancements backlog (Vaadin 10+) automation moved this from Inbox (needs triage) to Done / Pending Release Dec 28, 2023
mcollovati added a commit that referenced this issue Dec 28, 2023
Adds a configuration parameter that allows developers to
disable component tracking.

Fixes #18130
mshabarov added a commit to vaadin/docs that referenced this issue Jan 11, 2024
* docs: add instructions to disable component tracker

Part of vaadin/flow#18130

* Apply suggestions from code review

Co-authored-by: Tarek Oraby <42799254+tarekoraby@users.noreply.github.com>

* apply review suggestions

* First pass at editing touched files.

* Second pass at editing touched files.

---------

Co-authored-by: Tarek Oraby <42799254+tarekoraby@users.noreply.github.com>
Co-authored-by: russelljtdyer <6652767+russelljtdyer@users.noreply.github.com>
Co-authored-by: Mikhail Shabarov <61410877+mshabarov@users.noreply.github.com>
mcollovati added a commit to vaadin/docs that referenced this issue Jan 11, 2024
* docs: add instructions to disable component tracker

Part of vaadin/flow#18130

* Apply suggestions from code review

Co-authored-by: Tarek Oraby <42799254+tarekoraby@users.noreply.github.com>

* apply review suggestions

* First pass at editing touched files.

* Second pass at editing touched files.

---------

Co-authored-by: Tarek Oraby <42799254+tarekoraby@users.noreply.github.com>
Co-authored-by: russelljtdyer <6652767+russelljtdyer@users.noreply.github.com>
Co-authored-by: Mikhail Shabarov <61410877+mshabarov@users.noreply.github.com>
@vaadin-bot
Copy link
Collaborator

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

mshabarov added a commit to vaadin/docs that referenced this issue Jan 12, 2024
* docs: add instructions to disable component tracker

Part of vaadin/flow#18130

* Apply suggestions from code review



* apply review suggestions

* First pass at editing touched files.

* Second pass at editing touched files.

---------

Co-authored-by: Tarek Oraby <42799254+tarekoraby@users.noreply.github.com>
Co-authored-by: russelljtdyer <6652767+russelljtdyer@users.noreply.github.com>
Co-authored-by: Mikhail Shabarov <61410877+mshabarov@users.noreply.github.com>
rodolforfq pushed a commit that referenced this issue Feb 8, 2024
Adds a configuration parameter that allows developers to
disable component tracking.

Fixes #18130
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment