$ the-wire · showcase
Stepped binary_slice goes fast path, non-empty bitstring comprehensions inline
By RepoJournal · Filed · About Elixir & Phoenix · Composed from the cited sources · methodology
Elixir's binary_slice/2 now takes a fast path for single-byte stepped ranges, and a proposed compiler change would inline comprehensions into non-empty bitstring literals, at the cost of some changed error messages.
Optimize Kernel.binary_slice/2 for stepped ranges elixir-lang/elixir
Fast-paths single-byte stepped slices with binary_part/3 and precomputes skip = step - 1 before the binary comprehension, so the Erlang compiler can drop the per-iteration size subtraction and fallback match clauses. This finishes the work started in the earlier stepped-range optimization, meaning binary_slice/2 with a first..last//step range where the step selects single bytes avoids the gener...
Inline comprehensions into non-empty bitstrings elixir-lang/elixir
Previously only into: "" was compiled inline and every other bitstring went through the Collectable protocol; now binary generators append the comprehension to the prefix and other generators start the accumulator with it. The author, preciz, flags unavoidable regressions and writes that "Some raised error messages change," so treat this as a review-stage proposal rather than a settled behavior...
Optimize Kernel.binary_slice/2 for stepped ranges (#15989) elixir-lang/elixir
The commit lands the stepped-range optimization for Kernel.binary_slice/2, so it is the part of this work already on main rather than proposed.