user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
 Warning: Initial query:
 %22xt%2Fgit_async_cmp: do not slurp large OID list into memory%22
 returned no results, used:
 "xt/git_async_cmp: do not slurp large OID list into memory"
 instead

Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 0/9] more small fixes and cleanups
@ 2020-01-11 22:34  5% Eric Wong
  2020-01-11 22:35  7% ` [PATCH 7/9] xt/git_async_cmp: do not slurp large OID list into memory Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2020-01-11 22:34 UTC (permalink / raw)
  To: meta

One bugfix for solver, a couple of optimizations which will
make sense when dealing with many and larger code repos.
And some cleanups to reduce redundant code.

Eric Wong (9):
  config: do not slurp entire cgitrc at once
  git: modified: don't slurp `rev-parse --branches'
  git: packed_bytes: use GLOB_NOSORT
  solver: path_a may be undef from /dev/null
  cgit: drop cgit_parse_hdr wrapper
  xapcmd: use popen_rd for running xapian-compact
  xt/git_async_cmp: do not slurp large OID list into memory
  t/solver_git: avoid uninitialized warnings in hostname generation
  use popen_rd for bidirectional pipes

 lib/PublicInbox/Cgit.pm       |  9 ++-------
 lib/PublicInbox/Config.pm     |  4 ++--
 lib/PublicInbox/Git.pm        | 24 +++++++++++-------------
 lib/PublicInbox/Import.pm     |  8 +++-----
 lib/PublicInbox/SolverGit.pm  |  4 ++--
 lib/PublicInbox/V2Writable.pm | 11 +++--------
 lib/PublicInbox/Xapcmd.pm     | 16 +++++-----------
 t/solver_git.t                | 12 ++++++------
 xt/git_async_cmp.t            |  4 ++--
 9 files changed, 36 insertions(+), 56 deletions(-)

DELETE! DELETE! DELETE!

^ permalink raw reply	[relevance 5%]

* [PATCH 7/9] xt/git_async_cmp: do not slurp large OID list into memory
  2020-01-11 22:34  5% [PATCH 0/9] more small fixes and cleanups Eric Wong
@ 2020-01-11 22:35  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2020-01-11 22:35 UTC (permalink / raw)
  To: meta

I somehow thought "foreach (<$cat>)" could work like
"while (<$cat>)" when it came to iterating over file
handles...
---
 xt/git_async_cmp.t | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xt/git_async_cmp.t b/xt/git_async_cmp.t
index f8ffe3d9..18fce3db 100644
--- a/xt/git_async_cmp.t
+++ b/xt/git_async_cmp.t
@@ -27,7 +27,7 @@ my $async = timeit($nr, sub {
 	my $cat = $git->popen(@cat);
 	$git->cat_async_begin;
 
-	foreach (<$cat>) {
+	while (<$cat>) {
 		my ($oid, undef, undef) = split(/ /);
 		$git->cat_async($oid, $cb);
 	}
@@ -39,7 +39,7 @@ my $async = timeit($nr, sub {
 my $sync = timeit($nr, sub {
 	my $dig = Digest::SHA->new(1);
 	my $cat = $git->popen(@cat);
-	foreach (<$cat>) {
+	while (<$cat>) {
 		my ($oid, undef, undef) = split(/ /);
 		my $bref = $git->cat_file($oid);
 		$dig->add($$bref);

^ permalink raw reply related	[relevance 7%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2020-01-11 22:34  5% [PATCH 0/9] more small fixes and cleanups Eric Wong
2020-01-11 22:35  7% ` [PATCH 7/9] xt/git_async_cmp: do not slurp large OID list into memory Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).