Skip to content

bugfix/437-performance-regression#451

Open
AndrzejBuleczka wants to merge 33 commits into
masterfrom
bugfix/437-performance-regression
Open

bugfix/437-performance-regression#451
AndrzejBuleczka wants to merge 33 commits into
masterfrom
bugfix/437-performance-regression

Conversation

@AndrzejBuleczka
Copy link
Copy Markdown
Contributor

@AndrzejBuleczka AndrzejBuleczka commented Apr 21, 2026

Fixed performance regression on multiple charts render, closes #437.

@AndrzejBuleczka AndrzejBuleczka marked this pull request as draft April 22, 2026 09:54
@AndrzejBuleczka AndrzejBuleczka marked this pull request as draft April 22, 2026 09:54
@AndrzejBuleczka AndrzejBuleczka requested a review from wchmiel April 27, 2026 09:28
@AndrzejBuleczka AndrzejBuleczka marked this pull request as ready for review April 27, 2026 09:29
@AndrzejBuleczka
Copy link
Copy Markdown
Contributor Author

I reworked the v5 init path so the directive no longer relies on the old default 500ms timeout as a synchronization buffer. Instead of calling a fire-and-forget load() and then waiting before creating the chart, HighchartsChartService.load(partialConfig) now returns a real readiness promise for that directive’s exact config: it caches the shared Highcharts core/global setup once, loads partial modules for the current directive, and resolves only when that specific instance is ready to use. On the directive side, chart creation is now driven by that readiness signal rather than by an async computed() with a default wait, so we keep the async lifecycle boundary but remove the artificial startup penalty that was amplifying the regression on pages with many complex charts. In practice this restores behavior much closer to v4 because we are coordinating on actual module readiness instead of time-based guessing.

Copy link
Copy Markdown

@wchmiel wchmiel left a comment

Choose a reason for hiding this comment

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

I’ve tested the changes locally and it looks like the solution works and the bug has been fixed – well done ;) However, I think @karolkolodziej or someone involved more in maintaining the wrapper should check this, as there are some core changes here. I just have a few minor questions/requests.

Comment thread highcharts-angular/src/lib/highcharts-chart.directive.ts
Comment thread highcharts-angular/src/lib/highcharts-chart.directive.ts Outdated
Comment thread highcharts-angular/src/lib/highcharts-chart.directive.ts Outdated
Copy link
Copy Markdown
Contributor

@KacperMadej KacperMadej left a comment

Choose a reason for hiding this comment

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

Trashing time-based guessing for loading is good improvement.

I'm still a bit rusty with this repo and a lot has changed since I was actively involved in the development, so please take my review with a grain of salt.

Could you point me to the performance test that we could use in the future to make sure it's not dropping back down after, let's say HC v13 release?

With HC v13 being available currently as a beta release - have you tested this PR with it? It's not a must have but would be nice to check this in advance - there can be a follow up task to take care of this to avoid blocking this PR.

modules: () => [
import('highcharts/esm/modules/map'),
import('highcharts/esm/modules/tilemap'),
import('highcharts/esm/modules/map').then(() => import('highcharts/esm/modules/tilemap')),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Importing modules/map twice is needed for something? If no, the line above should be safe to remove.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Performance regression after upgrading from highcharts-angular v4.x to v5.x when rendering many complex charts

3 participants