示例#1
0
文件: run.py 项目: vanc/rejit
def plot_results():
    utils.command_assert(['scons', '-C', utils.dir_rejit, 'flot_js'])

    print("Plotting results...")

    html_file_results = open(
        join(utils.dir_benchmarks, 'benchmarks_results.html'), 'w')

    html_file_header = open(
        join(utils.dir_benchmarks_resources_html,
             'benchmarks_results.html.header'), 'r')
    html_file_results.write(html_file_header.read())
    html_file_header.close()

    html_file_results.write('<h2>Info</h2>\n')
    html_file_results.write('Date: %s<br/>\n' %
                            datetime.datetime.now().strftime("%Y/%m/%d %H:%M"))
    html_file_results.write('Command: <code>%s</code><br/>\n' %
                            ' '.join(sys.argv))
    iter_args = copy.deepcopy(vars(args))
    iter_args.pop('machine_description')
    html_file_results.write('Arguments: <code>%s</code><br/>\n' % iter_args)
    if args.machine_description:
        if not os.path.isfile(args.machine_description):
            utils.warning("Could not open '%s'" % args.machine_description)
        else:
            desc_file = open(args.machine_description, 'r')
            html_file_results.write('<h3>Machine description</h3>\n\n')
            html_file_results.write(desc_file.read())
            desc_file.close()

    html_file_results.write('<h3>Engines versions</h3>\n\n')
    html_file_results.write('<table style="text-align:right;">\n')
    html_file_results.write(
        '<tr><td>engine</td><td style="padding-left:50px;">commit</td></tr>')
    for engine in engines:
        html_file_results.write('<tr>\n')
        html_file_results.write(
            '  <td>%s</td><td style="padding-left:50px;"><pre style="padding:0 0 0 0;margin:0 0 0 0;">%s</pre></td>\n'
            % (engine.name, engine.commit_id()))
        html_file_results.write('</tr>\n')

    html_file_results.write('</table>\n')

    html_file_results.write('<h2>Results</h2>\n\n')
    html_file_results.write('<table>\n')
    for res in results:
        html_file_results.write(res.plot())
    html_file_results.write('</table>\n')

    html_file_footer = open(
        join(utils.dir_benchmarks_resources_html,
             'benchmarks_results.html.footer'), 'r')
    html_file_results.write(html_file_footer.read())
    html_file_footer.close()

    html_file_results.close()
示例#2
0
文件: run.py 项目: Kelimion/rejit
def plot_results():
  utils.command_assert(['scons', '-C', utils.dir_rejit, 'flot_js'])

  print("Plotting results...")

  html_file_results = open(join(utils.dir_benchmarks, 'benchmarks_results.html'), 'w')

  html_file_header = open(join(utils.dir_benchmarks_resources_html, 'benchmarks_results.html.header'), 'r')
  html_file_results.write(html_file_header.read())
  html_file_header.close()

  html_file_results.write('<h2>Info</h2>\n')
  html_file_results.write('Date: %s<br/>\n' % datetime.datetime.now().strftime("%Y/%m/%d %H:%M"))
  html_file_results.write('Command: <code>%s</code><br/>\n' % ' '.join(sys.argv))
  iter_args = copy.deepcopy(vars(args))
  iter_args.pop('machine_description')
  html_file_results.write('Arguments: <code>%s</code><br/>\n' % iter_args)
  if args.machine_description:
    if not os.path.isfile(args.machine_description):
      utils.warning("Could not open '%s'" % args.machine_description)
    else:
      desc_file = open(args.machine_description, 'r')
      html_file_results.write('<h3>Machine description</h3>\n\n')
      html_file_results.write(desc_file.read())
      desc_file.close()

  html_file_results.write('<h3>Engines versions</h3>\n\n')
  html_file_results.write('<table style="text-align:right;">\n')
  html_file_results.write('<tr><td>engine</td><td style="padding-left:50px;">commit</td></tr>')
  for engine in engines:
    html_file_results.write('<tr>\n')
    html_file_results.write('  <td>%s</td><td style="padding-left:50px;"><pre style="padding:0 0 0 0;margin:0 0 0 0;">%s</pre></td>\n' % (engine.name, engine.commit_id()))
    html_file_results.write('</tr>\n')

  html_file_results.write('</table>\n')

  html_file_results.write('<h2>Results</h2>\n\n')
  html_file_results.write('<table>\n')
  for res in results:
    html_file_results.write(res.plot())
  html_file_results.write('</table>\n')

  html_file_footer = open(join(utils.dir_benchmarks_resources_html, 'benchmarks_results.html.footer'), 'r')
  html_file_results.write(html_file_footer.read())
  html_file_footer.close()

  html_file_results.close()
示例#3
0
文件: run.py 项目: Kelimion/rejit
parser.add_argument('-v', '--verbose', action='store_true',
                    help='Print extra information.')

args = parser.parse_args()

# Use the engines specified on the command line.
engines = [engine for engine in engines if engine.name in args.engines]

# Build benchmarks in release mode.
if not args.nobuild:
  print("Building benchmarks...")
  for engine in engines:
    build_command = ['scons', '-C', utils.dir_rejit, engine.name + '_engine', '-j', str(args.jobs), "benchtest=on"]
    if args.nosimd:
      scons_command += ['simd=off']
    utils.command_assert(build_command)






# Benchmarks -------------------------------------------------------------------

class ResultSet:
  def __init__(self, benchmark):
    self.benchmark = benchmark
    self.data = {}
    self.time = str(math.floor(time.time() * 1000))

示例#4
0
文件: run.py 项目: vanc/rejit
args = parser.parse_args()

# Use the engines specified on the command line.
engines = [engine for engine in engines if engine.name in args.engines]

# Build benchmarks in release mode.
if not args.nobuild:
    print("Building benchmarks...")
    for engine in engines:
        build_command = [
            'scons', '-C', utils.dir_rejit, engine.name + '_engine', '-j',
            str(args.jobs), "benchtest=on"
        ]
        if args.nosimd:
            scons_command += ['simd=off']
        utils.command_assert(build_command)

# Benchmarks -------------------------------------------------------------------


class ResultSet:
    def __init__(self, benchmark):
        self.benchmark = benchmark
        self.data = {}
        self.time = str(math.floor(time.time() * 1000))

    def add_result(self, engine, output):
        if engine.name in self.data:
            utils.error("Results for engine %s already registered." %
                        engine.name)
        data_engine = {}