aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPéter Gömöri <[email protected]>2015-12-12 22:20:01 +0100
committerBjörn Gustavsson <[email protected]>2016-01-28 14:49:46 +0100
commit27b489736a6bd147bd694e83fc0948cbf9d2bce6 (patch)
treee03cc8c3c81366b5d1254c64db02749cb6d34114 /lib
parentd8161c3ad977c0e20c075ecf58d8ac5769637828 (diff)
downloadotp-27b489736a6bd147bd694e83fc0948cbf9d2bce6.tar.gz
otp-27b489736a6bd147bd694e83fc0948cbf9d2bce6.tar.bz2
otp-27b489736a6bd147bd694e83fc0948cbf9d2bce6.zip
Use file read buffering in dbg:trace_client
Trace files are typically large but contain small terms so we can expect a performance gain from read buffering. dbg:trace_client with a dummy handler ran more then 3x faster on a sample 200MB trace file. fprof:profile can also gain a bit.
Diffstat (limited to 'lib')
-rw-r--r--lib/runtime_tools/src/dbg.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/runtime_tools/src/dbg.erl b/lib/runtime_tools/src/dbg.erl
index d2a7d734c1..22b531e6ee 100644
--- a/lib/runtime_tools/src/dbg.erl
+++ b/lib/runtime_tools/src/dbg.erl
@@ -1269,7 +1269,7 @@ gen_reader(follow_file, Filename) ->
%% Opens a file and returns a reader (lazy list).
gen_reader_file(ReadFun, Filename) ->
- case file:open(Filename, [read, raw, binary]) of
+ case file:open(Filename, [read, raw, binary, read_ahead]) of
{ok, File} ->
mk_reader(ReadFun, File);
Error ->
@@ -1294,7 +1294,7 @@ mk_reader(ReadFun, Source) ->
mk_reader_wrap([]) ->
[];
mk_reader_wrap([Hd | _] = WrapFiles) ->
- case file:open(wrap_name(Hd), [read, raw, binary]) of
+ case file:open(wrap_name(Hd), [read, raw, binary, read_ahead]) of
{ok, File} ->
mk_reader_wrap(WrapFiles, File);
Error ->