diff options
author | Erlang/OTP <[email protected]> | 2019-03-29 19:25:45 +0100 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2019-03-29 19:25:45 +0100 |
commit | 370f7dcdaea7f2d506fb427f2dad02d627431727 (patch) | |
tree | e02121896f356f106d55c946e1fd4671f1456c32 | |
parent | d1330131457f117e12f0431533ea6a3152ea0536 (diff) | |
parent | 46e1565e73bc4490d29f0193146d4d75d9dba226 (diff) | |
download | otp-370f7dcdaea7f2d506fb427f2dad02d627431727.tar.gz otp-370f7dcdaea7f2d506fb427f2dad02d627431727.tar.bz2 otp-370f7dcdaea7f2d506fb427f2dad02d627431727.zip |
Merge branch 'john/kernel/compressed-file-read-degradation/OTP-15706/ERIERL-336' into maint-21
* john/kernel/compressed-file-read-degradation/OTP-15706/ERIERL-336:
erl_tar: Use read_ahead when reading compressed tar files
kernel: Fix performance regression on reading compressed files
-rw-r--r-- | lib/kernel/src/raw_file_io_inflate.erl | 2 | ||||
-rw-r--r-- | lib/stdlib/src/erl_tar.erl | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/kernel/src/raw_file_io_inflate.erl b/lib/kernel/src/raw_file_io_inflate.erl index 7e9780310c..d3ed02dd03 100644 --- a/lib/kernel/src/raw_file_io_inflate.erl +++ b/lib/kernel/src/raw_file_io_inflate.erl @@ -26,7 +26,7 @@ -include("file_int.hrl"). --define(INFLATE_CHUNK_SIZE, (1 bsl 10)). +-define(INFLATE_CHUNK_SIZE, (8 bsl 10)). -define(GZIP_WBITS, (16 + 15)). callback_mode() -> state_functions. diff --git a/lib/stdlib/src/erl_tar.erl b/lib/stdlib/src/erl_tar.erl index d8b8f466b1..7064fcacfa 100644 --- a/lib/stdlib/src/erl_tar.erl +++ b/lib/stdlib/src/erl_tar.erl @@ -324,7 +324,7 @@ do_open(Name, Mode) when is_list(Mode) -> open1({binary,Bin}, read, _Raw, Opts) when is_binary(Bin) -> case file:open(Bin, [ram,binary,read]) of {ok,File} -> - _ = [ram_file:uncompress(File) || Opts =:= [compressed]], + _ = [ram_file:uncompress(File) || lists:member(compressed, Opts)], {ok, #reader{handle=File,access=read,func=fun file_op/2}}; Error -> Error @@ -357,7 +357,7 @@ open_mode([read|Rest], false, Raw, Opts) -> open_mode([write|Rest], false, Raw, Opts) -> open_mode(Rest, write, Raw, Opts); open_mode([compressed|Rest], Access, Raw, Opts) -> - open_mode(Rest, Access, Raw, [compressed|Opts]); + open_mode(Rest, Access, Raw, [compressed,read_ahead|Opts]); open_mode([cooked|Rest], Access, _Raw, Opts) -> open_mode(Rest, Access, [], Opts); open_mode([], Access, Raw, Opts) -> |