apache / apache/couchdb

Use Erlang 26 features

Open
#4,467 1 comment 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Erlang
Stars
7k
Forks
1.1k
Avg merge
1d 16h
Merged PRs (30d)
9

Description

This issue is an experiment nicked from the Elixir project. Whenever a new Erlang version comes out, they go through the release notes and note any new features or issues that might affect Elixir. We should do the same for CouchDB.

Since we support older versions of Erlang, we usually can’t start adopting new features when they come out (unless we version-guard them, in cases where it is warranted, like opting into a substantial speedup on newer versions), but at least we have a check-list for things to adopt when the new Erlang version some day becomes our oldest-supported version.

Here’s a start from the [Erlang 26 RC1 release notes](https://www.erlang.org/news/160) and more detailed [Readme](https://erlang.org/download/otp_src_26.0-rc1.readme):
- [ ] [Time Warp Mode](https://www.erlang.org/doc/apps/erts/time_correction.html#time-warp-modes), [possible incompatibility](https://www.erlang.org/doc/apps/erts/time_correction.html#time-warp-safe-code).
- [ ] [JIT improvements](https://www.erlang.org/news/160#compiler-and-jit-optimizations): measure how much they impact CouchDB vs. Erlang 25.
- [ ] TODO: determine a useful measurement
- [ ] [Maps](https://www.erlang.org/news/160#maps):
- [ ] Are there places where we can benefit from [map comprehensions](https://www.erlang.org/eeps/eep-0058)?
- [ ] Do we rely on map key sort order anywhere?
- [ ] [Misc ERTS, Stdlib, Kernel, Compiler](https://www.erlang.org/news/160#misc-erts-stdlib-kernel-compiler):
- [ ] “Improved the selective receive optimization, which can now be enabled for references returned from other functions” how can one opt into this and does this help us? — Found [this PR implementation](https://github.com/erlang/otp/pull/6739/files), but not a lot smarter after reading it :) — [this (earlier?) PR also mentions receive optimisations](https://github.com/erlang/otp/pull/6045/files).
- [ ] “It is no longer necessary to enable a feature in the runtime system in order to load modules that are using it. It is sufficient to enable the feature in the compiler when compiling it.”
- [ ] Are we doing any of that and can we [stop it now](https://www.youtube.com/watch?app=desktop&v=U9t-slLl30E)?

Contributor guide

Open the contributing guide

Research direction

Start with the linked Erlang 26 RC1 release notes and detailed Readme, then review each unchecked item in the checklist: Time Warp Mode, JIT improvements, maps, and ERTS/stdlib/kernel/compiler changes. Compare the relevant behavior with Erlang 25 and document whether each item affects CouchDB, including a useful JIT measurement if applicable. Done means the checklist has findings and follow-up decisions for each item.

Written by the indexing model from the issue text.

Assessment

Tech stack
erlang
Domain
backend, databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.