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

elixir-gettext / gettext
94%
main: 94%

Build:
Build:
LAST BUILD BRANCH: extraction-merge-perf
DEFAULT BRANCH: main
Repo Added 17 Dec 2022 08:08AM UTC
Token HFyBNncfSvuOnEA0SjM0SpLlmUWqNQX4Z regen
Build 256 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 extraction-merge-perf
branch: SELECT
CHANGE BRANCH
x
Sync Branches
  • No branch selected
  • 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
  • backend-static-translations
  • 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
  • parallel-locale-merge
  • previous_messages
  • 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

16 Oct 2026 07:43AM UTC coverage: 93.704% (+0.04%) from 93.665%
7ff83017425c961f6231366d44573b89dca3da60-PR-445

Pull #445

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 #445: Remove redundant work from extraction, backend compilation and runtime interpolation

10 of 10 new or added lines in 2 files covered. (100.0%)

759 of 810 relevant lines covered (93.7%)

36.75 hits per line

Relevant lines Covered
Build:
Build:
810 RELEVANT LINES 759 COVERED LINES
36.75 HITS PER LINE
Source Files on main
  • Tree
  • List 19
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
7ff83017... extraction-merge-perf 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 #445 16 Oct 2026 07:45AM UTC oliver-kriska github
93.7
909b0efa... backend-static-translations Store translations without interpolation in a literal map Backends generate one function clause per translation, and the Erlang compiler spends most of a backend's compile time optimizing the huge functions this produces: on a catalog with 176 PO... Pull #446 15 Oct 2026 04:54PM UTC oliver-kriska github
93.77
45e14f04... main Keep the text before a binding that follows a literal %{} (#444) While splitting a string into interpolation segments, a literal "%{}" is appended to the current segment and the scan continues. If a binding then followed, that segment was dropped... push 15 Oct 2026 04:42PM UTC web-flow github
93.66
180931cb... extraction-merge-perf 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 #445 15 Oct 2026 03:26PM UTC oliver-kriska github
93.7
22495c74... backend-static-translations Store translations without interpolation in a literal map Backends generate one function clause per translation, and the Erlang compiler spends most of a backend's compile time optimizing the huge functions this produces: on a catalog with 176 PO... Pull #446 15 Oct 2026 03:25PM UTC oliver-kriska github
93.77
62f66fca... backend-static-translations Store translations without interpolation in a literal map Backends generate one function clause per translation, and the Erlang compiler spends most of a backend's compile time optimizing the huge functions this produces: on a catalog with 176 PO... Pull #446 15 Oct 2026 03:06PM UTC oliver-kriska github
93.77
b17f3d8a... extraction-merge-perf 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 #445 15 Oct 2026 02:44PM UTC oliver-kriska github
93.7
c29c9cee... main Add recompile-free extraction via persisted module attributes (#437) push 15 Oct 2026 02:15PM UTC web-flow github
93.66
ab2231d7... fix-literal-braces-before-binding Keep the text before a binding that follows a literal %{} While splitting a string into interpolation segments, a literal "%{}" is appended to the current segment and the scan continues. If a binding then followed, that segment was dropped instea... Pull #444 15 Oct 2026 02:05PM UTC oliver-kriska github
92.72
f5a94fc3... extract-from-attributes Write umbrella references relative to each application mix gettext.extract compiles each application of an umbrella from its own directory, so the references it writes are relative to the application (lib/app_one.ex:7). mix gettext.generate read ... Pull #437 15 Oct 2026 11:58AM UTC oliver-kriska github
93.66
See All Builds (177)

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