From: Yao Qi <yao@codesourcery.com>
To: Doug Evans <dje@google.com>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [RFC 2/3] Perf test framework
Date: Fri, 20 Sep 2013 08:04:00 -0000 [thread overview]
Message-ID: <523C015E.30902@codesourcery.com> (raw)
In-Reply-To: <21051.19430.251374.942418@ruffy.mtv.corp.google.com>
Doug, thanks for the review.
On 09/20/2013 03:09 AM, Doug Evans wrote:
> > +class PerfTestConfig(object):
> > + """
> > + Create the right objects according to file perftest.ini.
> > + """
> > +
> > + def __init__(self):
> > + self.config = ConfigParser.ConfigParser()
> > + self.config.read("perftest.ini")
> > +
> > + def get_reporter(self):
> > + """Create an instance of class Reporter which is determined by
> > + the option 'type' in section '[Reporter]'."""
> > + if not self.config.has_section('Reporter'):
> > + return reporter.TextReporter()
> > + if not self.config.has_option('Reporter', 'type'):
> > + return reporter.TextReporter()
> > +
> > + name = self.config.get('Reporter', 'type')
> > + cls = getattr(reporter, name)
> > + return cls()
> > +
> > +perftestconfig = PerfTestConfig()
>
> What do you see perftest.ini containing over time?
> While the file format is pretty trivial, it is another file format.
> Do we need it?
I was wondering that we can support json format, so I create class
PerfTestConfig and perftest.ini is used to determine which format to
be used. I agree that we can remove PerfTestConfig since we
only support only one format (plain text) nowadays.
> > +
> > + def invoke(self):
> > + """Call method 'execute_test' and '__report'."""
>
> As I read this, this comment just says what this function is doing.
> I'm guessing the point is to say that all such methods must, at the least,
> do these two things. This should be spelled out.
> It would also be good to document that "invoke" is what GDB calls
> to perform this function.
>
> Also, I'm wondering why execute_test is public and
> __report(-> _report) is private?
_report is private to be used only in class TestCase. I double checked
that private method can be overridden in python, so execute_test can be
private too. I'll do it in V2.
>
> > +
> > + self.execute_test()
> > + self.__report(perftestconfig.get_reporter())
> > + return "Done"
> > +
> > +class SingleVariableTestCase(TestCase):
> > + """Test case with a single variable."""
>
> I think this needs more documentation.
> What does "single variable" refer to? A single statistic, like wall time?
>
Yes, like wall time. How about "SingleStatisticTestCase" or
"SingleParameterTestCase"?
> > +
> > +class TestResult(object):
> > + """Base class to record or save test results."""
> > +
> > + def __init__(self, name):
> > + self.name = name
> > +
> > + def record (self, variable, result):
> > + raise RuntimeError("Abstract Method:record.")
> > +
> > + def report (self, reporter):
> > + """Report the test results by reporter."""
> > + raise RuntimeError("Abstract Method:report.")
> > +
> > +class SingleVariableTestResult(TestResult):
> > + """Test results for the test case with a single variable. """
> > +
> > + def __init__(self, name):
> > + super (SingleVariableTestResult, self).__init__ (name)
> > + self.results = dict ()
> > +
> > + def record(self, variable, result):
> > + self.results[variable] = result
>
> As things read (to me anyway), the class only handles a single variable,
> but the "record" method makes the variable a parameter.
> There's a disconnect here.
>
> Maybe the "variable" parameter to "record" is misnamed.
> E.g., if testing the wall time of performing something over a range of values,
> e.g., 1 solib, 8, solibs, 256 solibs, "variable" would be 1,8,256?
Yes, for solib test, "variable" is the number of shared libraries, and
"result" is the time usage for loading or unloading such number of
shared libraries.
> If that's the case, please rename "variable".
> I realize it's what is being varied run after run, but
> it just doesn't read well.
>
> There are two "variables" (so to speak) here:
> 1) What one is changing run after run. E.g. # solibs
> 2) What one is measuring. E.g. wall time, cpu time, memory used.
>
> The name "variable" feels too ambiguous.
> OTOH, if the performance testing world has a well established convention
> for what the word "variable" means, maybe I could live with it.:-)
>
How about renaming "variable" by "parameter"?
--
Yao (é½å°§)
next prev parent reply other threads:[~2013-09-20 8:04 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-14 13:01 [RFC] GDB performance testing infrastructure Yao Qi
2013-08-21 20:39 ` Tom Tromey
2013-08-27 6:21 ` Yao Qi
2013-08-27 13:49 ` Agovic, Sanimir
2013-08-28 3:04 ` Yao Qi
2013-09-19 0:36 ` Doug Evans
2013-08-28 4:17 ` [RFC 0/3] GDB Performance testing Yao Qi
2013-08-28 4:17 ` [RFC 3/3] Test on solib load and unload Yao Qi
2013-08-28 4:27 ` Yao Qi
2013-08-28 11:31 ` Agovic, Sanimir
2013-09-03 1:59 ` Yao Qi
2013-09-03 6:33 ` Agovic, Sanimir
2013-09-02 15:24 ` Blanc, Nicolas
2013-09-03 2:04 ` Yao Qi
2013-09-03 7:50 ` Blanc, Nicolas
2013-09-19 22:45 ` Doug Evans
2013-09-20 19:19 ` Tom Tromey
2013-10-05 0:34 ` Doug Evans
2013-10-07 16:31 ` Tom Tromey
2013-09-22 6:25 ` Yao Qi
2013-09-23 0:14 ` Doug Evans
2013-09-24 2:31 ` Yao Qi
2013-10-05 0:37 ` Doug Evans
2013-09-20 19:14 ` Tom Tromey
2013-08-28 4:17 ` [RFC 1/3] New make target 'check-perf' and new dir gdb.perf Yao Qi
2013-08-28 9:40 ` Agovic, Sanimir
2013-09-19 17:47 ` Doug Evans
2013-09-20 19:00 ` Tom Tromey
2013-09-20 18:59 ` Tom Tromey
2013-08-28 4:17 ` [RFC 2/3] Perf test framework Yao Qi
2013-08-28 9:57 ` Agovic, Sanimir
2013-09-03 1:45 ` Yao Qi
2013-09-03 6:38 ` Agovic, Sanimir
2013-09-19 19:09 ` Doug Evans
2013-09-20 8:04 ` Yao Qi [this message]
2013-09-20 16:51 ` Doug Evans
2013-09-22 2:54 ` Yao Qi
2013-09-22 23:14 ` Doug Evans
2013-09-20 17:12 ` Doug Evans
2013-09-19 17:25 ` [RFC 0/3] GDB Performance testing Doug Evans
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=523C015E.30902@codesourcery.com \
--to=yao@codesourcery.com \
--cc=dje@google.com \
--cc=gdb-patches@sourceware.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