git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Duy Nguyen <pclouds@gmail.com>
To: "Torsten Bögershausen" <tboegi@web.de>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH v2 2/2] convert.c: stream and fast search for binary
Date: Sat, 29 Oct 2016 19:13:47 +0700	[thread overview]
Message-ID: <CACsJy8C6=m9uKc+RcL+jJWmCcKQiPc7Qm92y3zd3aUFp+nOVFA@mail.gmail.com> (raw)
In-Reply-To: <20161012134727.28365-1-tboegi@web.de>

On Wed, Oct 12, 2016 at 8:47 PM,  <tboegi@web.de> wrote:
> From: Torsten Bögershausen <tboegi@web.de>
>
> When statistics are done for the autocrlf handling, the search in
> the content can be stopped, if e.g
> - a search for binary is done, and a NUL character is found
> - a search for CRLF is done, and the first CRLF is found.
>
> Similar when statistics for binary vs non-binary are gathered:
> Whenever a lone CR or NUL is found, the search can be aborted.
>
> When checking out files in "auto" mode, any file that has a "lone CR"
> or a CRLF will not be converted, so the search can be aborted early.
>
> Add the new bit, CONVERT_STAT_BITS_ANY_CR,
> which is set for either lone CR or CRLF.
>
> Many binary files have a NUL very early and it is often not necessary
> to load the whole content of a file or blob into memory.
>
> Split gather_stats() into gather_all_stats() and gather_stats_partly()
> to do a streaming handling for blobs and files in the worktree.

Maybe break this commit down a bit? the gather_all_stats and
gather_stats_partly() seem independent and can standalone. So is the
blob streaming, and get_convert_stats_wt.
-- 
Duy

      parent reply	other threads:[~2016-10-29 12:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-09  9:56 [PATCH v1 0/2] convert: stream and early out tboegi
2016-10-10 20:19 ` Junio C Hamano
2016-10-12 13:47 ` [PATCH v2 0/2] Stream and fast search tboegi
2016-10-27 17:02   ` Junio C Hamano
2016-10-12 13:47 ` [PATCH v2 1/2] read-cache: factor out get_sha1_from_index() helper tboegi
2016-10-27 19:57   ` Junio C Hamano
2016-10-29 12:22   ` Duy Nguyen
2016-10-12 13:47 ` [PATCH v2 2/2] convert.c: stream and fast search for binary tboegi
2016-10-27 21:18   ` Junio C Hamano
2016-11-01  9:36     ` Torsten Bögershausen
2016-10-29 12:13   ` Duy Nguyen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACsJy8C6=m9uKc+RcL+jJWmCcKQiPc7Qm92y3zd3aUFp+nOVFA@mail.gmail.com' \
    --to=pclouds@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=tboegi@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.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).