Improve perf of tm api with global search #595

Closed
pascalchevrel opened this Issue Jan 19, 2016 · 1 comment

Comments

Projects
None yet
1 participant
@pascalchevrel
Member

pascalchevrel commented Jan 19, 2016

We have already improved the perf of this view with the fix of getRepoStrings() but I found ways to make it faster and also simplify the getTranslationMemoryResults() method.

@pascalchevrel pascalchevrel self-assigned this Jan 19, 2016

pascalchevrel added a commit to pascalchevrel/transvision that referenced this issue Jan 19, 2016

pascalchevrel added a commit to pascalchevrel/transvision that referenced this issue Jan 20, 2016

Issue #595 faster Translation Memory (tm) API
- If we repo does not contain any result, we skip it (and avoid calculation). If the strinf searched exists in one repo only, this can divide time by 10 at least
- Moved the loading of $target_strings after the above check, no need to load them if there are no match
- We no longer load target strings for all repos and send them to ShowResults::getTranslationMemoryResults(), we filter the arrays early to only have target strings with the same keys as the source strings we looked for, this way we avoid sending noise to the function
- Minor simplification of ShowResults::getTranslationMemoryResults() parameters

pascalchevrel added a commit to pascalchevrel/transvision that referenced this issue Jan 20, 2016

Issue #595 faster Translation Memory (tm) API
- If we repo does not contain any result, we skip it (and avoid calculation). If the searched string exists in one repo only, this can divide time by 10 at least
- Moved the loading of $target_strings after the above check, no need to load them if there are no match
- We no longer load target strings for all repos and send them to ShowResults::getTranslationMemoryResults(), we filter the arrays early to only have target strings with the same keys as the source strings we looked for, this way we avoid sending noise to the function
- We remove duplicate strings to reduce the number of strings we need to sent to ShowResults::getTranslationMemoryResults()
- We use the + operator instead of array_merge, it's slightly faster and the functional difference don't matter in this case
- Minor simplification of ShowResults::getTranslationMemoryResults() parameters

more optims

pascalchevrel added a commit to pascalchevrel/transvision that referenced this issue Jan 20, 2016

Issue #595 faster Translation Memory (tm) API
- If we repo does not contain any result, we skip it (and avoid calculation). If the searched string exists in one repo only, this can divide time by 10 at least
- Moved the loading of $target_strings after the above check, no need to load them if there are no match
- We no longer load target strings for all repos and send them to ShowResults::getTranslationMemoryResults(), we filter the arrays early to only have target strings with the same keys as the source strings we looked for, this way we avoid sending noise to the function
- We remove duplicate target strings to reduce the number of strings we need to sent to ShowResults::getTranslationMemoryResults()
- We use the + operator instead of array_merge, it's slightly faster and the functional difference don't matter in this case
- Minor simplification of ShowResults::getTranslationMemoryResults() parameters

more optims

pascalchevrel added a commit to pascalchevrel/transvision that referenced this issue Jan 20, 2016

Issue #595 faster Translation Memory (tm) API
- If we repo does not contain any result, we skip it (and avoid calculation). If the searched string exists in one repo only, this can divide time by 10 at least
- Moved the loading of $target_strings after the above check, no need to load them if there are no match
- We no longer load target strings for all repos and send them to ShowResults::getTranslationMemoryResults(), we filter the arrays early to only have target strings with the same keys as the source strings we looked for, this way we avoid sending noise to the function
- We remove duplicate target strings to reduce the number of strings we need to sent to ShowResults::getTranslationMemoryResults()
- We use the + operator instead of array_merge, it's slightly faster and the functional difference don't matter in this case
- Minor simplification of ShowResults::getTranslationMemoryResults() parameters

more optims

pascalchevrel added a commit to pascalchevrel/transvision that referenced this issue Jan 20, 2016

Issue #595 faster Translation Memory (tm) API
- If we repo does not contain any result, we skip it (and avoid calculation). If the searched string exists in one repo only, this can divide time by 10 at least
- Moved the loading of $target_strings after the above check, no need to load them if there are no match
- We no longer load target strings for all repos and send them to ShowResults::getTranslationMemoryResults(), we filter the arrays early to only have target strings with the same keys as the source strings we looked for, this way we avoid sending noise to the function
- We remove duplicate target strings to reduce the number of strings we need to sent to ShowResults::getTranslationMemoryResults()
- We use the + operator instead of array_merge, it's slightly faster and the functional difference don't matter in this case
- Minor simplification of ShowResults::getTranslationMemoryResults() parameters

more optims

flodolo added a commit that referenced this issue Jan 20, 2016

Merge pull request #596 from pascalchevrel/global_tm_api_perf
Issue #595 faster Translation Memory (tm) API
@pascalchevrel

This comment has been minimized.

Show comment
Hide comment
@pascalchevrel

pascalchevrel Jan 20, 2016

Member

perf improved between x2 and x4 depending on cases, should be good enough.

Member

pascalchevrel commented Jan 20, 2016

perf improved between x2 and x4 depending on cases, should be good enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment