git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Sam Hocevar <sam@hocevar.net>
To: git@vger.kernel.org
Subject: [PATCH] git-p4: reverse large file detection order
Date: Fri, 28 Feb 2020 16:07:10 +0100	[thread overview]
Message-ID: <20200228150710.ikgijcxlft5wjl3h@hocevar.net> (raw)

It is more efficient to first check for a file's extension against
git-p4.largeFileExtensions before git-p4.largeFileCompressedThreshold
because the latter test may trigger a costly compression task.

Signed-off-by: Sam Hocevar <sam@hocevar.net>
---
 git-p4.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git git-p4.py git-p4.py
index 40d9e7c594..a54970aa74 100755
--- git-p4.py
+++ git-p4.py
@@ -1197,7 +1197,7 @@ def processContent(self, git_mode, relPath, contents):
         """Processes the content of git fast import. This method decides if a
            file is stored in the large file system and handles all necessary
            steps."""
-        if self.exceedsLargeFileThreshold(relPath, contents) or self.hasLargeFileExtension(relPath):
+        if self.hasLargeFileExtension(relPath) or self.exceedsLargeFileThreshold(relPath, contents):
             contentTempFile = self.generateTempFile(contents)
             (pointer_git_mode, contents, localLargeFile) = self.generatePointer(contentTempFile)
             if pointer_git_mode:
-- 
2.25.1

                 reply	other threads:[~2020-02-28 15:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20200228150710.ikgijcxlft5wjl3h@hocevar.net \
    --to=sam@hocevar.net \
    --cc=git@vger.kernel.org \
    /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).