git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "René Scharfe" <l.s.r@web.de>
To: Jeff King <peff@peff.net>, Adrian Dudau <Adrian.Dudau@enea.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: [PATCH 2/2] pretty: use fmt_output_email_subject()
Date: Wed, 1 Mar 2017 16:41:36 +0100	[thread overview]
Message-ID: <373c7cca-3fd8-bf25-f45b-16249f160ee5@web.de> (raw)
In-Reply-To: <58e05599-5dc4-9881-d8c0-89ad1f2e3838@web.de>

Am 01.03.2017 um 12:37 schrieb René Scharfe:
> Add the email-style subject prefix (e.g. "Subject: [PATCH] ") directly
> when it's needed instead of letting log_write_email_headers() prepare
> it in a static buffer in advance.  This simplifies storage ownership and
> code flow.
>
> Signed-off-by: Rene Scharfe <l.s.r@web.de>
> ---
> This slows down the last three tests in p4000 by ca. 3% for some reason,
> so we may want to only do the first part for now, which is performance
> neutral on my machine.

Update below.

> diff --git a/commit.h b/commit.h
> index 9c12abb911..459daef94a 100644
> --- a/commit.h
> +++ b/commit.h
> @@ -142,21 +142,24 @@ static inline int cmit_fmt_is_mail(enum cmit_fmt fmt)
>  	return (fmt == CMIT_FMT_EMAIL || fmt == CMIT_FMT_MBOXRD);
>  }
>
> +struct rev_info; /* in revision.h, it circularly uses enum cmit_fmt */
> +
>  struct pretty_print_context {
>  	/*
>  	 * Callers should tweak these to change the behavior of pp_* functions.
>  	 */
>  	enum cmit_fmt fmt;
>  	int abbrev;
> -	const char *subject;
>  	const char *after_subject;
>  	int preserve_subject;
>  	struct date_mode date_mode;
>  	unsigned date_mode_explicit:1;
> +	unsigned print_email_subject:1;

Turning this into an int restores performance according to p4000. 
Didn't know that bitfields can be *that* expensive.

René

  reply	other threads:[~2017-03-02  0:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-28 15:59 format-patch subject-prefix gets truncated when using the --numbered flag Adrian Dudau
2017-02-28 17:42 ` Junio C Hamano
2017-02-28 19:33   ` Junio C Hamano
2017-02-28 22:44     ` Jeff King
2017-02-28 18:17 ` Jeff King
2017-03-01 11:36   ` [PATCH 1/2] log-tree: factor out fmt_output_email_subject() René Scharfe
2017-03-01 11:37   ` [PATCH 2/2] pretty: use fmt_output_email_subject() René Scharfe
2017-03-01 15:41     ` René Scharfe [this message]
2017-03-01 18:08     ` Junio C Hamano
2017-03-01 19:32       ` Jeff King
2017-03-01 19:38         ` Junio C Hamano
2017-03-01 19:43           ` Jeff King
2017-03-01 19:22     ` Jeff King

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=373c7cca-3fd8-bf25-f45b-16249f160ee5@web.de \
    --to=l.s.r@web.de \
    --cc=Adrian.Dudau@enea.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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).