Recall those benchmarks I mentioned post-flight?  They used this test here
but with another suite of uncommitted changes—another day's worth of
refactoring.  The magnitude of impact from the arena changes alone dwarfed
time.Date and all others.  Food for thought.

Message composed via terrorphone terrorcommunications device and is
probably frought with typos and misspellings and syntax errors.
Am 21.05.2013 01:20 schrieb "juliusv" <notifications@github.com>:

> In storage/metric/memory_test.go:
>
> > +	"runtime"
> > +	"testing"
> > +	"time"
> > +)
> > +
> > +func BenchmarkStreamAdd(b *testing.B) {
> > +	b.StopTimer()
> > +	s := newStream(model.Metric{})
> > +
> > +	b.StartTimer()
> > +
> > +	var pre runtime.MemStats
> > +	runtime.ReadMemStats(&pre)
> > +
> > +	for i := 0; i < b.N; i++ {
> > +		s.add(time.Date(i, 0, 0, 0, 0, 0, 0, time.UTC), model.SampleValue(i))
>
> To ensure that you're measuring only the thing you care about (s.add),
> could you pre-create all the samples into an array before you start timing?
> If you look at the implementation of time.Date, it's not a very
> light-weight function at all, so it will raise the offset of your
> benchmarks: http://golang.org/src/pkg/time/time.go?s=27615:27698#L955
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/prometheus/prometheus/pull/258/files#r4307970>
> .
>