X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=blobdiff_plain;f=xt%2Fperf-msgview.t;fp=xt%2Fperf-msgview.t;h=ef261359bbc76e6281da091abf952e2c330918e7;hp=7f92ce858a2e4cb5172a6832447c9f0fe26b14bd;hb=bb3e51c9fdaf1059c2ae8368a527b4bd87b0b423;hpb=3a281094eecdc37c5f3efbe0a39ad04ba31a9dab diff --git a/xt/perf-msgview.t b/xt/perf-msgview.t index 7f92ce85..ef261359 100644 --- a/xt/perf-msgview.t +++ b/xt/perf-msgview.t @@ -11,6 +11,8 @@ use PublicInbox::WwwStream; my $inboxdir = $ENV{GIANT_INBOX_DIR} // $ENV{GIANT_PI_DIR}; my $blob = $ENV{TEST_BLOB}; +my $obfuscate = $ENV{PI_OBFUSCATE} ? 1 : 0; +diag "PI_OBFUSCATE=$obfuscate"; plan skip_all => "GIANT_INBOX_DIR not defined for $0" unless $inboxdir; my @cat = qw(cat-file --buffer --batch-check --batch-all-objects); @@ -21,7 +23,8 @@ if (require_git(2.19, 1)) { "git <2.19, cat-file lacks --unordered, locality suffers\n"; } require_mods qw(Plack::Util); -my $ibx = PublicInbox::Inbox->new({ inboxdir => $inboxdir, name => 'name' }); +my $ibx = PublicInbox::Inbox->new({ inboxdir => $inboxdir, name => 'name', + obfuscate => $obfuscate}); my $git = $ibx->git; my $fh = $blob ? undef : $git->popen(@cat); if ($fh) { @@ -46,10 +49,11 @@ $ctx->{mhref} = '../'; my $cb = sub { $eml = PublicInbox::Eml->new(shift); $eml->each_part(\&PublicInbox::View::add_text_body, $ctx, 1); - $ctx->zflush; + $ctx->zflush(grep defined, delete @$ctx{'obuf'}); # compat ++$m; delete $ctx->{zbuf}; - ${$ctx->{obuf}} = ''; + ${$ctx->{obuf}} = ''; # compat + $ctx->{gz} = PublicInbox::GzipFilter::gzip_or_die(); }; my $t = timeit(1, sub {