diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-04-23 19:24:19 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-04-23 21:40:50 +0200 |
commit | 4756ec3cd8ef998f889619fe11be70cc900e2b75 (patch) | |
tree | 22a799a89b4b67f7709d64af60fda7666cbe8e1d /tpl | |
parent | 4c3c5120389cc95edc63b8f18a0eee786aa0c5e2 (diff) |
i18n: Avoid rebuilding the Translations map for every lookup
```bash
benchmark old ns/op new ns/op delta
BenchmarkI18nTranslate/all-present-4 764 757 -0.92%
BenchmarkI18nTranslate/present-in-default-4 2578 1457 -43.48%
BenchmarkI18nTranslate/present-in-current-4 764 766 +0.26%
BenchmarkI18nTranslate/missing-4 3362 1103 -67.19%
BenchmarkI18nTranslate/file-missing-4 4646 3611 -22.28%
BenchmarkI18nTranslate/context-provided-4 2013 2014 +0.05%
BenchmarkI18nTranslate/same-id-and-translation-4 1961 784 -60.02%
BenchmarkI18nTranslate/same-id-and-translation-default-4 3717 1405 -62.20%
BenchmarkI18nTranslate/unknown-language-code-4 1775 1787 +0.68%
benchmark old allocs new allocs delta
BenchmarkI18nTranslate/all-present-4 6 6 +0.00%
BenchmarkI18nTranslate/present-in-default-4 16 10 -37.50%
BenchmarkI18nTranslate/present-in-current-4 6 6 +0.00%
BenchmarkI18nTranslate/missing-4 20 8 -60.00%
BenchmarkI18nTranslate/file-missing-4 27 21 -22.22%
BenchmarkI18nTranslate/context-provided-4 15 15 +0.00%
BenchmarkI18nTranslate/same-id-and-translation-4 12 6 -50.00%
BenchmarkI18nTranslate/same-id-and-translation-default-4 22 10 -54.55%
BenchmarkI18nTranslate/unknown-language-code-4 13 13 +0.00%
benchmark old bytes new bytes delta
BenchmarkI18nTranslate/all-present-4 152 152 +0.00%
BenchmarkI18nTranslate/present-in-default-4 1144 216 -81.12%
BenchmarkI18nTranslate/present-in-current-4 152 152 +0.00%
BenchmarkI18nTranslate/missing-4 2008 152 -92.43%
BenchmarkI18nTranslate/file-missing-4 1208 600 -50.33%
BenchmarkI18nTranslate/context-provided-4 704 704 +0.00%
BenchmarkI18nTranslate/same-id-and-translation-4 1080 152 -85.93%
BenchmarkI18nTranslate/same-id-and-translation-default-4 2073 216 -89.58%
BenchmarkI18nTranslate/unknown-language-code-4 696 696 +0.00%
```
Fixes #5892
Diffstat (limited to 'tpl')
0 files changed, 0 insertions, 0 deletions