• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

elixir-gettext / gettext
94%
main: 94%

Build:
Build:
LAST BUILD BRANCH: bound-gettext-merge-concurrency
DEFAULT BRANCH: main
Repo Added 17 Dec 2022 08:08AM UTC
Token HFyBNncfSvuOnEA0SjM0SpLlmUWqNQX4Z regen
Build 268 Last
Files 19
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

LAST BUILD ON BRANCH cache-interpolation-patterns
branch: cache-interpolation-patterns
CHANGE BRANCH
x
Reset
Sync Branches
  • cache-interpolation-patterns
  • abdelhalim97/add-put_locale!
  • al/1.18
  • al/ci
  • al/deprecate-plural-forms
  • al/expo-plural
  • al/new-backend-docs
  • al/no-recompilation
  • al/refactor
  • al/release
  • al/use-gettext-backend
  • avoid-duplicate-pot-read
  • backend-static-translations
  • bound-gettext-merge-concurrency
  • ci-bump-elixir-1.19-otp-28
  • code-coverage
  • dependabot/github_actions/actions/checkout-5.0.0
  • dependabot/github_actions/actions/checkout-6.0.0
  • dependabot/github_actions/actions/checkout-6.0.1
  • dependabot/github_actions/actions/checkout-6.0.2
  • dependabot/github_actions/actions/checkout-6.0.3
  • dependabot/github_actions/actions/checkout-7.0.0
  • dependabot/github_actions/actions/checkout-7.0.1
  • dependabot/github_actions/erlef/setup-beam-1.20.2
  • dependabot/github_actions/erlef/setup-beam-1.20.4
  • dependabot/github_actions/erlef/setup-beam-1.21.0
  • dependabot/github_actions/erlef/setup-beam-1.24.0
  • dependabot/github_actions/erlef/setup-beam-1.24.1
  • deprecation_message
  • extract-from-attributes
  • extract_force_compile
  • extraction-merge-perf
  • fix-concatenation-of-sigils
  • fix-literal-braces-before-binding
  • fix-nofile
  • fix-typos
  • fix/elixir-1.20-warnings
  • fix/extract-timeout
  • improve-docs
  • indexed-merge-template
  • introduce_initial_top_comments_via_messages_struct
  • jm/ci_deps_check_locked
  • jm/conflicting_plural_message_400
  • jm/default_header
  • jm/deps-update
  • jm/dialyzer-setup
  • jm/extend_plural_interface
  • jm/extract_merge_always
  • jm/flaky_test_mix_cache
  • jm/gh-workflow-updates
  • jm/legalese
  • jm/mention-igniter-changelog
  • jm/metadata-stripping
  • jm/plural_mod_function_fix
  • jm/release/v0.23.2
  • jm/singular_plural_uniq
  • jv-erase-manifest-unless-on-upcoming-elixir
  • jv-fix-redefining
  • keep_custom_flags_option
  • main
  • msg_sort_iodata
  • on-missing-translation
  • parallel-locale-merge
  • plural-info-once
  • previous_messages
  • prune-fuzzy-candidates
  • refs/pull/376/merge
  • release/v0.22.2
  • release/v0.27.0
  • runtime-gettext
  • sort_by_msgid_case_insensitive
  • test_up_to_date
  • tiny_fix
  • wait-for-gettext-merge

26 Oct 2026 08:59AM UTC coverage: 93.796% (+0.03%) from 93.765%
7cf265ab8a241d4d49ce8a7174504a511b3bb517-PR-450

Pull #450

github

oliver-kriska
Compile the interpolation patterns once per VM

to_interpolatable/1 compiled the "%{" and "}" patterns with
:binary.compile_pattern/1 on every call. Each compilation costs about as
much as splitting a short string, and this function runs on every runtime
interpolation: whenever the current locale has no translation for a
message, including every render in the default locale of an application
without a PO file for it, and once per message at compile time.

A compiled pattern is a reference, so it cannot live in a module attribute;
the two patterns are now compiled on first use and kept in persistent_term.
Passing the literal strings to :binary.split/2 instead would compile them
again on every split and gets slower as the number of bindings grows.

Microbenchmark of runtime_interpolate/2 (compiled loop, median of 7
alternating samples, Elixir 1.20.4 / OTP 29, one scheduler; OTP 27 within
5% of these):

    input                        before    after
    no bindings                  0.44 us   0.15 us
    1 binary binding             0.72 us   0.39 us
    3 binary bindings            1.06 us   0.78 us
    32 bindings                  7.76 us   7.27 us
    long text, 1 binding         0.75 us   0.45 us
Pull Request #450: Cache compiled interpolation patterns across calls

6 of 6 new or added lines in 1 file covered. (100.0%)

771 of 822 relevant lines covered (93.8%)

36.69 hits per line

Relevant lines Covered
Build:
Build:
822 RELEVANT LINES 771 COVERED LINES
36.69 HITS PER LINE
Source Files on cache-interpolation-patterns
  • Tree
  • List 19
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
7cf265ab... cache-interpolation-patterns Compile the interpolation patterns once per VM to_interpolatable/1 compiled the "%{" and "}" patterns with :binary.compile_pattern/1 on every call. Each compilation costs about as much as splitting a short string, and this function runs on every ... Pull #450 26 Oct 2026 09:04AM UTC oliver-kriska github
93.8
See All Builds (189)

Badge your Repo: gettext

We detected this repo isn’t badged! Grab the embed code to the right, add it to your repo to show off your code coverage, and when the badge is live hit the refresh button to remove this message.

Could not find badge in README.

Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

Refresh
  • Settings
  • Repo on GitHub
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc