summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/time-smoother.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-10-29 01:49:40 +0100
committerLennart Poettering <lennart@poettering.net>2009-10-29 01:49:40 +0100
commit2edb4df175ee69e386ec3923e69af6899f55e2eb (patch)
tree6252831e16b81dcb9b1eeaec255e8804cd875656 /src/pulsecore/time-smoother.c
parentf27a50691c8fe45bac7dd6b21fac91a359def3a1 (diff)
smoother: add comments about optimization recommendations from Jason Newton
Diffstat (limited to 'src/pulsecore/time-smoother.c')
-rw-r--r--src/pulsecore/time-smoother.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/pulsecore/time-smoother.c b/src/pulsecore/time-smoother.c
index d6c37878..1371ad56 100644
--- a/src/pulsecore/time-smoother.c
+++ b/src/pulsecore/time-smoother.c
@@ -196,6 +196,13 @@ static double avg_gradient(pa_smoother *s, pa_usec_t x) {
int64_t ax = 0, ay = 0, k, t;
double r;
+ /* FIXME: Optimization: Jason Newton suggested that instead of
+ * going through the history on each iteration we could calculated
+ * avg_gradient() as we go.
+ *
+ * Second idea: it might make sense to weight history entries:
+ * more recent entries should matter more than old ones. */
+
/* Too few measurements, assume gradient of 1 */
if (s->n_history < s->min_history)
return 1;