diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2008-10-16 11:56:19 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2008-10-19 09:36:53 +0100 |
commit | f2ff7944264c23cbec856be3e85f240a93184f80 (patch) | |
tree | 0c14c7d36b71bcb92bf244b6eede1eec5b4aa4ea /perf/cairo-perf.h | |
parent | 41c8eefc6d432ab213f6f405c3d6346adb7f7931 (diff) | |
download | cairo-f2ff7944264c23cbec856be3e85f240a93184f80.tar.gz |
[perf] A crude tool to visualise performance changes across a series.
Generate a cairo-perf-diff graph for a series of commits in order to be
able to identify significant commits. Still very crude, but minimally
functional.
Diffstat (limited to 'perf/cairo-perf.h')
-rw-r--r-- | perf/cairo-perf.h | 61 |
1 files changed, 60 insertions, 1 deletions
diff --git a/perf/cairo-perf.h b/perf/cairo-perf.h index 4a75dc110..57fe85f11 100644 --- a/perf/cairo-perf.h +++ b/perf/cairo-perf.h @@ -32,7 +32,13 @@ typedef uint64_t cairo_perf_ticks_t; -#include "cairo-stats.h" +typedef struct _cairo_stats { + cairo_perf_ticks_t min_ticks; + cairo_perf_ticks_t median_ticks; + double ticks_per_ms; + double std_dev; + int iterations; +} cairo_stats_t; /* timers */ @@ -93,6 +99,59 @@ cairo_perf_cover_sources_and_operators (cairo_perf_t *perf, const char *name, cairo_perf_func_t perf_func); +/* reporter convenience routines */ + +typedef struct _test_report { + int id; + const char *configuration; + char *backend; + char *content; + char *name; + int size; + + /* The samples only exists for "raw" reports */ + cairo_perf_ticks_t *samples; + unsigned int samples_size; + unsigned int samples_count; + + /* The stats are either read directly or computed from samples. + * If the stats have not yet been computed from samples, then + * iterations will be 0. */ + cairo_stats_t stats; +} test_report_t; + +typedef struct _test_diff { + test_report_t **tests; + int num_tests; + double min; + double max; + double change; +} test_diff_t; + +typedef struct _cairo_perf_report { + char *configuration; + const char *name; + test_report_t *tests; + int tests_size; + int tests_count; +} cairo_perf_report_t; + +typedef enum { + TEST_REPORT_STATUS_SUCCESS, + TEST_REPORT_STATUS_COMMENT, + TEST_REPORT_STATUS_ERROR +} test_report_status_t; + +void +cairo_perf_report_load (cairo_perf_report_t *report, + const char *filename); + +void +cairo_perf_report_sort_and_compute_stats (cairo_perf_report_t *report); + +int +test_report_cmp_backend_then_name (const void *a, const void *b); + #define CAIRO_PERF_DECL(func) void (func) (cairo_perf_t *perf, cairo_t *cr, int width, int height) CAIRO_PERF_DECL (fill); |