Improve performance #92
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Performance improvements
@thchia I've started introducing the fixes discussed in this issue #85. In addition to
getTranslationsForLanguagebeing slow I also found thatgetSingleToMultilanguageTranslationwas also extremely slow with large amounts of data, and also usedarray.reduce. I've swapped these both out to use plain ol' for loops, and the results seem to be really good.In order to test these scenarios I added a seed translations script that allows for you to easily create dummy translation files with large sets of data. I've pumped up the translations to 20,000, and while there is slight lag I believe there is still room for improvements.
If you want to run the demo locally you will need to use
npm linkto point it to the local version of react-localize-redux`.