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

Optimize normalize_flat_keys #528

Merged

Conversation

krzysiek1507
Copy link
Contributor

@krzysiek1507 krzysiek1507 commented May 23, 2020

Calculating -------------------------------------
            original     1.060k memsize (     0.000  retained)
                        21.000  objects (     0.000  retained)
                         7.000  strings (     0.000  retained)
               patch   652.000  memsize (     0.000  retained)
                        14.000  objects (     0.000  retained)
                         7.000  strings (     0.000  retained)

Comparison:
               patch:        652 allocated
            original:       1060 allocated - 1.63x more

Warming up --------------------------------------
            original    15.765k i/100ms
               patch    18.043k i/100ms
Calculating -------------------------------------
            original    156.733k (± 3.5%) i/s -    788.250k in   5.036161s
               patch    180.959k (± 1.9%) i/s -    920.193k in   5.086948s

Comparison:
               patch:   180959.0 i/s
            original:   156733.1 i/s - 1.15x  (± 0.00) slower

I18n::Backend::Flatten.normalize_flat_keys :en, :home, [:country, :county, :second], '|'

Calculating -------------------------------------
            original     1.060k memsize (     0.000  retained)
                        21.000  objects (     0.000  retained)
                         7.000  strings (     0.000  retained)
               patch   652.000  memsize (     0.000  retained)
                        14.000  objects (     0.000  retained)
                         7.000  strings (     0.000  retained)

Comparison:
               patch:        652 allocated
            original:       1060 allocated - 1.63x more

Warming up --------------------------------------
            original    15.765k i/100ms
               patch    18.043k i/100ms
Calculating -------------------------------------
            original    156.733k (± 3.5%) i/s -    788.250k in   5.036161s
               patch    180.959k (± 1.9%) i/s -    920.193k in   5.086948s

Comparison:
               patch:   180959.0 i/s
            original:   156733.1 i/s - 1.15x  (± 0.00) slower
@krzysiek1507 krzysiek1507 force-pushed the feature/optimize-normalize_flat_keys branch from 5b04f13 to 4031429 Compare May 23, 2020 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants