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

MessageFormatTranspiler.transpile takes a lot of time #358

Closed
k3nsei opened this issue Oct 6, 2020 · 2 comments
Closed

MessageFormatTranspiler.transpile takes a lot of time #358

k3nsei opened this issue Oct 6, 2020 · 2 comments
Assignees

Comments

@k3nsei
Copy link

k3nsei commented Oct 6, 2020

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[x] Performance issue
[x] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

MessageFormatTranspiler.transpile method takes a lot of time almost 3ms.

Zrzut ekranu 2020-10-05 o 11 31 34

Zrzut ekranu 2020-10-6 o 12 38 43

Expected behavior

Messages can be pre-transpiled when translations are set or loaded. Then generated closure can be memoized. To not parse them with every rerender.

Minimal reproduction of the problem with instructions

https://stackblitz.com/edit/transloco-example-izuqre?file=src/app/app.component.ts

What is the motivation / use case for changing the behavior?

Better performance

Environment


Angular version: 6.1.10


Browser:
- [x] Chrome (desktop) version 85
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: 10.22.0  
- Platform:  Mac 

Others:

@itayod
Copy link
Contributor

itayod commented Oct 7, 2020

Hi, I hope I could get to it soon as I am pretty busy these days...
In the mean time you are welcome to create a pr for it.

@k3nsei
Copy link
Author

k3nsei commented Oct 7, 2020

@itayod If I manage to find time, I will definitely try to improve it by myself.

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

No branches or pull requests

2 participants