aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2015-04-28 10:21:02 +0200
committerBjörn Gustavsson <[email protected]>2015-05-06 10:19:23 +0200
commit20a72ca2d491d6efa720828becb783c20e4508b5 (patch)
tree4824fb0b217888b66ec70f7d317420eb5503a718 /lib/kernel
parent7309ff4c3832588cc15565ff264db2a120e6092e (diff)
downloadotp-20a72ca2d491d6efa720828becb783c20e4508b5.tar.gz
otp-20a72ca2d491d6efa720828becb783c20e4508b5.tar.bz2
otp-20a72ca2d491d6efa720828becb783c20e4508b5.zip
kernel application: Start code server first
When the code server has started, it will read the .beam files for all loaded modules to see whether they contain native code that should be loaded. To make that as fast as possible when we have no native code, start the code server as early as possible to minimize the number .beam files that must be read from disk. The code server does not use the 'file' module, so it is OK to start the code server before starting the file_server process. On my computer, the time for checking the loaded modules for native code is reduced from roughly 2 ms to 1.5 ms.
Diffstat (limited to 'lib/kernel')
-rw-r--r--lib/kernel/src/kernel.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/kernel/src/kernel.erl b/lib/kernel/src/kernel.erl
index ecdb32424a..cc5683ba06 100644
--- a/lib/kernel/src/kernel.erl
+++ b/lib/kernel/src/kernel.erl
@@ -117,7 +117,7 @@ init([]) ->
[{local, kernel_safe_sup}, ?MODULE, safe]},
permanent, infinity, supervisor, [?MODULE]},
{ok, {SupFlags,
- [File, Code, StdError, User,
+ [Code, File, StdError, User,
Config, SafeSupervisor]}};
_ ->
Rpc = {rex, {rpc, start_link, []},
@@ -139,8 +139,8 @@ init([]) ->
[{local, kernel_safe_sup}, ?MODULE, safe]},
permanent, infinity, supervisor, [?MODULE]},
{ok, {SupFlags,
- [Rpc, Global, InetDb | DistAC] ++
- [NetSup, Glo_grp, File, Code,
+ [Code, Rpc, Global, InetDb | DistAC] ++
+ [NetSup, Glo_grp, File,
StdError, User, Config, SafeSupervisor] ++ Timer}}
end;
init(safe) ->