From 1b336f995d930d6542e67310b72d855e3571523f Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Tue, 26 Apr 2016 14:31:42 +0200 Subject: tools: Optimize adding multiple modules to an Xref server Extracting data from debug info in BEAM files is parallelized. The speed-up is not outstanding. If memory is not an issue, adding `{spawn_opt, [{min_heap_size, }]}' to the option list of xref:start/2 can make a (small) difference. Reading of modules from a directory is parallelized. Attempts to parallelize all modules when adding a release have been rejected since the gain showed to be small compared to the increased complexity of the code. Using a process for coordinating the reading has not been attempted. --- lib/tools/src/xref_utils.erl | 8 -------- 1 file changed, 8 deletions(-) (limited to 'lib/tools/src/xref_utils.erl') diff --git a/lib/tools/src/xref_utils.erl b/lib/tools/src/xref_utils.erl index f69aa70244..b0c168e018 100644 --- a/lib/tools/src/xref_utils.erl +++ b/lib/tools/src/xref_utils.erl @@ -47,8 +47,6 @@ -export([options/2]). --export([subprocess/2]). - -export([format_error/1]). -import(lists, [append/1, delete/2, filter/2, foldl/3, foreach/2, @@ -512,12 +510,6 @@ find_beam(Culprit) -> options(Options, Valid) -> split_options(Options, [], [], [], Valid). -subprocess(Fun, Opts) -> - Pid = spawn_opt(Fun, Opts), - receive - {Pid, Reply} -> Reply - end. - format_error({error, Module, Error}) -> Module:format_error(Error); format_error({file_error, FileName, Reason}) -> -- cgit v1.2.3