nickva commented on code in PR #4443:
URL: https://github.com/apache/couchdb/pull/4443#discussion_r1119288950


##########
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's on-par or faster than the previous approach before the persist term 
update:
   
   ```
    element(1, timer:tc(fun() -> (fun F(0) -> ok; F(N) -> config:features(), 
F(N-1) end)(1000000) end)) / 1000000.
   1.201835
   ```



-- 
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]

Reply via email to