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

add new batch value to prepare lazy loading faeture of lix #2671

Merged
merged 2 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions inlang/source-code/plugins/i18next/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ async function loadMessages(args: {
args.settings.sourceLanguageTag
)

// split languageTags into batches, based on experiements < 20 is slow for too many iterations and > 50 is slow for too many parallel file handlings so it seems like a good default.
const batchSize = 30
// split languageTags into batches, based on experiements < 20 is slow for too many iterations and > 50 is slow for too many parallel file handlings so it seems like a good default. For lazy loading to work we need to try to be as big as possible here, so we use the upper limit
const batchSize = 50
const languageTagBatches: LanguageTag[][] = []
for (let i = 0; i < languageTags.length; i += batchSize) {
languageTagBatches.push(languageTags.slice(i, i + batchSize))
Expand Down
3 changes: 2 additions & 1 deletion lix/packages/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
pnpm-lock.yaml
pnpm-lock.yaml
gitea
Loading