ruby-i18n / ruby-i18n/ruby-cldr

`--merge` should memoize the results for performance

Open
#161 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
78
Forks
18
Avg merge
9d 8h
Merged PRs (30d)
3

Description

--merge currently takes a long time, needlessly.

Instead of iterating over each locale in turn and merging in the ancestor locales each time:

en-CA -> en -> root
en-GB -> en -> root
en-US -> en -> root

All of these use the en -> root, which is the same data, so there is no need to recompute those for each child locale.

Instead, you could iterate over the graph of locales breadth-first starting at the root locale, then cache the results for use in the other locales.

(Of course, this might not be worth doing as the whole concept of --merge is likely to change. I just wanted to capture this potential optimization here)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the --merge implementation and tracing how ancestor locales are merged for each locale. Compare the current traversal with the proposed breadth-first approach from root, then verify that shared ancestor data is computed once and the merged output remains unchanged. The issue names no specific files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
cli, performance
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.