Skip to content

Commit

Permalink
Merge branch 'john/kernel/compressed-file-read-degradation/OTP-15706/…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
Erlang/OTP committed Mar 29, 2019
2 parents d133013 + 46e1565 commit 370f7dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/kernel/src/raw_file_io_inflate.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions lib/stdlib/src/erl_tar.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) ->
Expand Down

0 comments on commit 370f7dc

Please sign in to comment.