mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-08 21:58:04 +02:00
perf: Eliminate CAIRO_STATS_MIN_VALID_SAMPLES
We don't need this at this deep level since callers can now implement this limiting manually since stats.iterations is now returned. Also, this was interfering with the -i option to cairo-perf anyway.
This commit is contained in:
parent
6d5df0e3e2
commit
0d1340f716
3 changed files with 4 additions and 19 deletions
|
|
@ -105,7 +105,6 @@ cairo_perf_run (cairo_perf_t *perf,
|
|||
cairo_perf_func_t perf_func)
|
||||
{
|
||||
static cairo_bool_t first_run = TRUE;
|
||||
cairo_stats_status_t status;
|
||||
unsigned int i;
|
||||
cairo_perf_ticks_t *times;
|
||||
cairo_stats_t stats = {0.0, 0.0};
|
||||
|
|
@ -155,10 +154,8 @@ cairo_perf_run (cairo_perf_t *perf,
|
|||
cairo_perf_ticks_per_second () / 1000.0);
|
||||
printf (" %lld", times[i]);
|
||||
} else {
|
||||
if (i >= CAIRO_STATS_MIN_VALID_SAMPLES) {
|
||||
status = _cairo_stats_compute (&stats, times, i+1);
|
||||
if (status == CAIRO_STATS_STATUS_NEED_MORE_DATA)
|
||||
continue;
|
||||
if (i > 0) {
|
||||
_cairo_stats_compute (&stats, times, i+1);
|
||||
|
||||
if (stats.std_dev <= CAIRO_PERF_LOW_STD_DEV) {
|
||||
low_std_dev_count++;
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ _cairo_perf_ticks_cmp (const void *_a, const void *_b)
|
|||
return 0;
|
||||
}
|
||||
|
||||
cairo_stats_status_t
|
||||
void
|
||||
_cairo_stats_compute (cairo_stats_t *stats,
|
||||
cairo_perf_ticks_t *values,
|
||||
int num_values)
|
||||
|
|
@ -78,9 +78,6 @@ _cairo_stats_compute (cairo_stats_t *stats,
|
|||
while (i + num_valid < num_values && values[i+num_valid] < outlier_max)
|
||||
num_valid++;
|
||||
|
||||
if (num_valid < CAIRO_STATS_MIN_VALID_SAMPLES)
|
||||
return CAIRO_STATS_STATUS_NEED_MORE_DATA;
|
||||
|
||||
stats->iterations = num_valid;
|
||||
stats->min_ticks = values[min_valid];
|
||||
|
||||
|
|
@ -103,6 +100,4 @@ _cairo_stats_compute (cairo_stats_t *stats,
|
|||
/* Let's use a std. deviation normalized to the mean for easier
|
||||
* comparison. */
|
||||
stats->std_dev = sqrt(sum / num_valid) / mean;
|
||||
|
||||
return CAIRO_STATS_STATUS_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,13 +28,6 @@
|
|||
|
||||
#include "cairo-perf.h"
|
||||
|
||||
#define CAIRO_STATS_MIN_VALID_SAMPLES 20
|
||||
|
||||
typedef enum {
|
||||
CAIRO_STATS_STATUS_SUCCESS,
|
||||
CAIRO_STATS_STATUS_NEED_MORE_DATA
|
||||
} cairo_stats_status_t;
|
||||
|
||||
typedef struct _cairo_stats {
|
||||
cairo_perf_ticks_t min_ticks;
|
||||
cairo_perf_ticks_t median_ticks;
|
||||
|
|
@ -43,7 +36,7 @@ typedef struct _cairo_stats {
|
|||
int iterations;
|
||||
} cairo_stats_t;
|
||||
|
||||
cairo_stats_status_t
|
||||
void
|
||||
_cairo_stats_compute (cairo_stats_t *stats,
|
||||
cairo_perf_ticks_t *values,
|
||||
int num_values);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue