The Wire · Showcase
ELIXIR CORE CUTS MAP LOOKUP WASTE
By RepoJournal · Filed · About Elixir & Phoenix
Two pull requests into Elixir's type system are eliminating needless rebuilds that could slow pattern matching in core compiler workflows.
PR #15786, merged into elixir-lang/elixir, makes negated map lookups skip rebuilding the remaining map Binary Decision Diagram when only the selected domain is needed [1]. The same author, Barna Kovacs, also landed PR #15785, which avoids rebuilding and hashing the canonical non-empty list top leaf when the tail is term() [2]. Both changes target the type system's hot paths, where construction of immediately discarded state was pure overhead. "Use the existing domain lookup helper directly so negated map lookups do not construct state that is immediately discarded," the PR description notes [1]. Expect modest but real wins in compilation times for type-heavy codebases. The commits are already in main, so pull them into any forks or nightly builds you track for Elixir core development [1][2].
One email a day. Unsubscribe in one click.
Keep up with Elixir & Phoenix in about 3 minutes a day: what actually shipped — the commits, pull requests, releases, and security advisories that matter.
One email a day. Unsubscribe in one click. Read a past issue →
Action items
- → Pull the latest Elixir main to include PRs #15785 and #15786 elixir-lang/elixir [monitor]
References
- [1] Avoid rebuilding map domains during lookup ↗ elixir-lang/elixir
- [2] Reuse the top non-empty list descriptor ↗ elixir-lang/elixir