From ecb7a05eb0f8912ef972489be2b7d648065b51c7 Mon Sep 17 00:00:00 2001 From: Siri Hansen Date: Thu, 2 Nov 2017 17:04:03 +0100 Subject: [ct] Remove call to application:which_applications() The cth_log_redirect hook calls this function to check if the sasl application is started. This is done for each error logger event. In most systems, this is not a big problem, but on native compiled code this call can be very slow if the message queue is long. This is because huge message queue optimization is not implemented for native. --- lib/common_test/src/cth_log_redirect.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/common_test/src/cth_log_redirect.erl b/lib/common_test/src/cth_log_redirect.erl index 8b29d0f96d..1c55e17686 100644 --- a/lib/common_test/src/cth_log_redirect.erl +++ b/lib/common_test/src/cth_log_redirect.erl @@ -121,8 +121,8 @@ handle_event({_Type,GL,_Msg}, #eh_state{handle_remote_events = false} = State) when node(GL) /= node() -> {ok, State}; handle_event(Event, #eh_state{log_func = LogFunc} = State) -> - case lists:keyfind(sasl, 1, application:which_applications()) of - false -> + case whereis(sasl_sup) of + undefined -> sasl_not_started; _Else -> {ok, ErrLogType} = application:get_env(sasl, errlog_type), -- cgit v1.2.3