From: Ingo Molnar <mingo@kernel.org>
To: Jiri Olsa <jolsa@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
lkml <linux-kernel@vger.kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
David Ahern <dsahern@gmail.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: [PATCH 5/7] perf tools: Optimize sample parsing for ordered events
Date: Tue, 31 Oct 2017 10:40:54 +0100 [thread overview]
Message-ID: <20171031094053.iblfii2hzz7keujh@gmail.com> (raw)
In-Reply-To: <20171031092947.19410-6-jolsa@kernel.org>
* Jiri Olsa <jolsa@kernel.org> wrote:
> Currently when using ordered events we parse the sample
> twice (the perf_evlist__parse_sample function). Once
> before we queue the sample for sorting:
>
> perf_session__process_event
> perf_evlist__parse_sample(sample)
> perf_session__queue_event(sample.time)
>
> And then when we deliver the sorted sample:
>
> ordered_events__deliver_event
> perf_evlist__parse_sample
> perf_session__deliver_event
>
> We can skip the initial full sample parsing by using
> perf_evlist__parse_sample_timestamp function, which
> got introduced earlier. The new path looks like:
>
> perf_session__process_event
> perf_evlist__parse_sample_timestamp
> perf_session__queue_event
>
> ordered_events__deliver_event
> perf_session__deliver_event
> perf_evlist__parse_sample
>
> It saves some instructions and is slightly faster:
>
> Before:
> Performance counter stats for './perf.old report --stdio' (5 runs):
>
> 64,396,007,225 cycles:u ( +- 0.97% )
> 105,882,112,735 instructions:u # 1.64 insn per cycle ( +- 0.00% )
>
> 21.618103465 seconds time elapsed ( +- 1.12% )
>
> After:
> Performance counter stats for './perf report --stdio' (5 runs):
>
> 60,567,807,182 cycles:u ( +- 0.40% )
> 104,853,333,514 instructions:u # 1.73 insn per cycle ( +- 0.00% )
>
> 20.168895243 seconds time elapsed ( +- 0.32% )
That's a 7% speedup, not bad!
Thanks,
Ingo
next prev parent reply other threads:[~2017-10-31 9:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-31 9:29 [PATCH 0/7] perf tools: Small sample parsing speedup Jiri Olsa
2017-10-31 9:29 ` [PATCH 1/7] perf tools: Reset cursor arg instead of callchain_cursor Jiri Olsa
2017-10-31 9:29 ` [PATCH 2/7] perf tools: Centralize perf_sample initialization Jiri Olsa
2017-10-31 9:29 ` [PATCH 3/7] perf tools: Add perf_evlist__parse_sample_timestamp function Jiri Olsa
2017-10-31 9:29 ` [PATCH 4/7] perf tools: Pass timestamp arg in perf_session__queue_event Jiri Olsa
2017-10-31 9:29 ` [PATCH 5/7] perf tools: Optimize sample parsing for ordered events Jiri Olsa
2017-10-31 9:40 ` Ingo Molnar [this message]
2017-10-31 9:29 ` [PATCH 6/7] perf tools: Remove perf_tool from event_op2 Jiri Olsa
2017-10-31 9:29 ` [PATCH 7/7] perf tools: Remove perf_tool from event_op3 Jiri Olsa
2017-11-01 8:39 ` [PATCH 0/7] perf tools: Small sample parsing speedup Namhyung Kim
2017-11-01 11:50 ` Jiri Olsa
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171031094053.iblfii2hzz7keujh@gmail.com \
--to=mingo@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=dsahern@gmail.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=namhyung@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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox