nickva commented on code in PR #4443:
URL: https://github.com/apache/couchdb/pull/4443#discussion_r1119279324
##########
src/config/src/config.erl:
##########
@@ -212,23 +212,23 @@ delete(Section, Key, Persist, Reason) when
is_list(Section), is_list(Key) ->
).
features() ->
- application:get_env(config, enabled_features, []).
+ Map = persistent_term:get({?MODULE, ?FEATURES}, #{}),
+ lists:sort(maps:keys(Map)).
Review Comment:
It looks minimal about an extra 1 microsecond at most with the default
features list.
```
element(1, timer:tc(fun() -> (fun F(0) -> ok; F(N) -> config:features(),
F(N-1) end)(1000000) end)) / 1000000.
1.014499
```
`config:features()` would be used from the Welcome endpoint only, specific
feature checks would be quicker as we don't need to sort a list in that case.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]