Closed g1tc4t closed 10 months ago
We've also encountered the issue and confirmed this resolves the problem. Thx for the investigation @g1tc4t, I've opened a pr with your fix https://github.com/lephyrus/ngx-translate-messageformat-compiler/pull/111
@g1tc4t So little code and I've managed to introduce a function that doesn't scale well at all. 🤦 Thanks for the investigation and verifying a fix.
@Endrzei Thanks for the PR.
Fixed by #112.
When loading a large translation file (a few thousand entries) the browser needs a few seconds to parse the entries. Doing some performance investigations I found that the spread operator used in
translate-message-format-compiler.ts
leads toO(n)=n²
This can be fixed to be
O(n)=n
quite easily: