$ the-wire · showcase
Faster Range.disjoint?, LiveUploader trims copies, Ecto filter/2 docs corrected
By RepoJournal · Filed · About Elixir & Phoenix · Composed from the cited sources · methodology
Elixir's Range.disjoint?/2 now finds intersections with modulo instead of floor divisions, and Phoenix LiveView removes redundant array copies in LiveUploader, while Ecto documents that filter/2 has limited database support.
Range.disjoint?/2 was rewritten to find the first intersection using modulo in the later progression, dropping floor divisions and redundant bounds checks [1]. The same change is described as doing less math with the same result, and is expected to run around 1.3x faster [2]. This is internal arithmetic in a hot path, not a new API.
Alongside that, José Valim landed a safe_relative_to deprecation in Elixir [3] and added a --coverage-format text option with agentic usage instructions [4]. If your tooling parses coverage output, the new text format option is the one to check; the deprecation is the one to watch for warnings.
In Phoenix LiveView, redundant array copies were removed from LiveUploader [5], and the assets were updated [6]. Ecto, meanwhile, updated the filter/2 docs to note limited database support [7]. If you use filter/2 in code that runs against more than one database, the docs now say so plainly.
No security fixes and no breaking changes are in this batch. The performance work in Range.disjoint?/2 and LiveUploader is the substance; the Ecto note is a documentation correction that prevents a wrong assumption.
Action items
- → Run your test suite with --coverage-format text to check the new text output elixir-lang/elixir [plan]
- → Check for safe_relative_to warnings before upgrading Elixir elixir-lang/elixir [monitor]
- → Review Ecto filter/2 usage against databases it does not fully support elixir-ecto/ecto [plan]
References
- [1] Simplify Range.disjoint?/2 intersection arithmetic (#15884) ↗ elixir-lang/elixir
- [2] Simplify Range.disjoint?/2 intersection arithmetic ↗ elixir-lang/elixir
- [3] Add safe_relative_to deprecation ↗ elixir-lang/elixir
- [4] Add --coverage-format text option and agentic usage instructions ↗ elixir-lang/elixir
- [5] Remove redundant array copies in LiveUploader (#4439) ↗ phoenixframework/phoenix_live_view
- [6] Update assets ↗ phoenixframework/phoenix_live_view
- [7] Update filter/2 docs to note limited database support (#4791) ↗ elixir-ecto/ecto