-
-
Notifications
You must be signed in to change notification settings - Fork 487
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
The more translations (routes) the lower performance #690
Comments
How are you measuring TPS? |
I used apache jmeter and thread kept calling root and measuring throughput. |
@rchl |
I haven't had time to try it out yet but planning to do that at some point. |
It looks like it's mostly the extra routes that nuxt-i18n generates that contribute to the performance issue. So it really looks like a pure Nuxt (or VueRouter) issue. I don't know if I'll have time to look into it more soon. Maybe someone from core team will (@pi0, @atinux, @manniL). This issue could be even moved to Nuxt repo. nuxt-i18n with default settings from the repo (focus on
strategy
nuxt_i18n disabled:
nuxt_i18n disabled + only a single
(Note: that for testing I've disabled message loading ( |
@rchl |
It's most likely this code creating various maps and lists of routes and especially heavy use of regexpes in it: Such things might be hard to optimize as those are things that can't just be skipped. But I don't know that code so maybe there is something that can be done. FYI @posva |
This comment has been minimized.
This comment has been minimized.
@nxut/content-theme-docs nuxt-modules#690
Will Removing translation messages (locales files) from the lang directory and fetching them through Axios gonna make any difference? |
The issue identified here is related to the number of routes and not locale files or messages. Fetching them with axios is only gonna make things slower. |
@rchl, please invite someone from the core team to investigate the issue. I guess this issue needs to be solved asap. |
Any update regarding this issue? Upgraded from nuxt-i18n to nuxtjs/i18n but still no improvement. |
Hello, Quite interesting that you are blaming this module, it has been already explained that this is upstream issue that can't be fixed here. Also, if this is needs to be solved ASAP, you could just push a PR with the fix. Would be really helpful, right? Thanks! |
First of all, no way I'm blaming the module. |
It's an upstream issue so it would more relevant to track nuxt/nuxt#7473 for example. |
This comment has been minimized.
This comment has been minimized.
About a year ago, I encountered the same issue. My solution involved forking and rewriting the module so that it doesn't create a separate route for each locale. Instead, it allows setting up
for In case of missing value in I believe this module could be updated to support this route setup method through parameters or by manually parsing the routes as another option. |
Performance still gets noticeably worse due to the amount of routes generated in v8 (Nuxt 3), we're tracking this in nuxt/nuxt#25612 and vuejs/router#2132. |
Closing this as v7 is not being actively worked on (critical hotfixes only), if this still applies to v8 and later please open a new issue! |
Version
nuxt-i18n: ^6.10.1 (latest)
nuxt: ^2.0.0 (latest)
Reproduction Link
https://github.com/hoiheart/nuxt-issue-demo/tree/i18n-performance
Steps to reproduce
When the TPS is measured under the same conditions,
What is Expected?
The request throughput must be similar before and after the module is used. (639 TPS)
What is actually happening?
When the TPS is measured under the same conditions,
Since it's a test on a personal PC, the TPS figure doesn't mean much.
But the decline is significant.
If you have any problems with my setup, please give me some advice
The text was updated successfully, but these errors were encountered: