From dbcc6ad0ec0c5eaca5b9a63c712c9ddc27a43f90 Mon Sep 17 00:00:00 2001 From: Yevhenii Reizner Date: Sun, 3 Dec 2023 22:17:29 +0200 Subject: [PATCH] Remove outdated perf tools. --- tools/perf/README.md | 13 ---------- tools/perf/elementary.json | 31 ----------------------- tools/perf/oxygen.json | 31 ----------------------- tools/perf/perf.py | 51 -------------------------------------- 4 files changed, 126 deletions(-) delete mode 100644 tools/perf/README.md delete mode 100644 tools/perf/elementary.json delete mode 100644 tools/perf/oxygen.json delete mode 100755 tools/perf/perf.py diff --git a/tools/perf/README.md b/tools/perf/README.md deleted file mode 100644 index e9938305..00000000 --- a/tools/perf/README.md +++ /dev/null @@ -1,13 +0,0 @@ -## Perf - -Let's say we want to check `resvg` performance: - -``` -./perf.py resvg-qt ../../../resvg/target/release/rendersvg /svg_path /tmp_dir -``` - -Chart can be created via [barh](https://github.com/RazrFalcon/barh): - -``` -barh oxygen.json ../../site/images/perf.svg -``` diff --git a/tools/perf/elementary.json b/tools/perf/elementary.json deleted file mode 100644 index 92d39e2a..00000000 --- a/tools/perf/elementary.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "title": "Time to render Elementary OS Icon Theme 5.0 (3417 files)", - "items": [ - { - "value": 15, - "name": "cairo-backend" - }, - { - "value": 27, - "name": "qt-backend" - }, - { - "value": 22, - "name": "raqote-backend" - }, - { - "value": 16, - "name": "skia-backend" - } - ], - "hor_axis": { - "round_tick_values": true, - "title": "Time passed", - "width": 700, - "suffix": "sec" - }, - "items_font": { - "family": "Arial", - "size": 12 - } -} diff --git a/tools/perf/oxygen.json b/tools/perf/oxygen.json deleted file mode 100644 index 36a5dcf4..00000000 --- a/tools/perf/oxygen.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "title": "Time to render Oxygen Icon Theme 4.12 (4947 files)", - "items": [ - { - "value": 125, - "name": "cairo-backend" - }, - { - "value": 126, - "name": "qt-backend" - }, - { - "value": 144, - "name": "raqote-backend" - }, - { - "value": 110, - "name": "skia-backend" - } - ], - "hor_axis": { - "round_tick_values": true, - "title": "Time passed", - "width": 700, - "suffix": "sec" - }, - "items_font": { - "family": "Arial", - "size": 12 - } -} diff --git a/tools/perf/perf.py b/tools/perf/perf.py deleted file mode 100755 index f66a2db2..00000000 --- a/tools/perf/perf.py +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env python3 - -import argparse -import os -import subprocess -import time - - -def render_file(exe, backend, zoom): - res = subprocess.run([exe, in_svg, out_png, '--backend', backend, '-z', str(zoom)], - stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) - return res.returncode == 0 - - -if __name__ == '__main__': - parser = argparse.ArgumentParser() - parser.add_argument('--zoom', help='Zoom', type=float, default=1) - parser.add_argument('backend', help='Backend', - choices=['qt', 'cairo', 'raqote', 'skia']) - parser.add_argument('exe', help='Render executable') - parser.add_argument('in_dir', help='Input directory') - parser.add_argument('out_dir', help='Output directory') - args = parser.parse_args() - - if not os.path.exists(args.out_dir): - os.mkdir(args.out_dir) - - svg_files = [] - broken_files = [] - - start_time = time.time() - for root, _, files in os.walk(args.in_dir): - for file_name in files: - file_stem, file_ext = os.path.splitext(file_name) - if file_ext == '.svg': - abs_path_in = os.path.join(root, file_name) - abs_path_out = os.path.join(args.out_dir, file_stem + '.png') - svg_files.append((abs_path_in, abs_path_out)) - - for idx, file in enumerate(svg_files): - print('{} out of {}'.format(idx + 1, len(svg_files)), end='\r') - in_svg, out_png = file - if not render_file(args.exe, args.backend, args.zoom): - broken_files.append(in_svg) - - elapsed_time = time.time() - start_time - print() - print('{:.2f}sec'.format(elapsed_time)) - - if broken_files: - print('Failed:', broken_files)