<commit_before>package analytic

import (
	"testing"

	"github.com/ready-steady/probability"
	"github.com/ready-steady/probability/uniform"
	"github.com/ready-steady/support/assert"
)

func TestCompute(t *testing.T) {
	temperature := load("002")

	cc := uint(2)
	sc := uint(len(fixtureP)) / cc

	Q := temperature.Compute(fixtureP, sc)

	assert.EqualWithin(Q, fixtureQ, 1e-12, t)
}

func BenchmarkCompute(b *testing.B) {
	temperature := load("032")

	cc := uint(32)
	sc := uint(1000)

	P := probability.Sample(uniform.New(0, 1), cc*sc)

	b.ResetTimer()

	for i := 0; i < b.N; i++ {
		temperature.Compute(P, sc)
	}
}<commit_msg>Added a benchmark for 002 in analytic<commit_after>package analytic

import (
	"testing"

	"github.com/ready-steady/probability"
	"github.com/ready-steady/probability/uniform"
	"github.com/ready-steady/support/assert"
)

func TestCompute(t *testing.T) {
	temperature := load("002")
	sc := uint(len(fixtureP)) / 2

	Q := temperature.Compute(fixtureP, sc)

	assert.EqualWithin(Q, fixtureQ, 1e-12, t)
}

func BenchmarkCompute002(b *testing.B) {
	temperature := load("002")
	sc := uint(len(fixtureP)) / 2

	b.ResetTimer()

	for i := 0; i < b.N; i++ {
		temperature.Compute(fixtureP, sc)
	}
}

func BenchmarkCompute032(b *testing.B) {
	temperature := load("032")
	cc, sc := uint(32), uint(1000)

	P := probability.Sample(uniform.New(0, 1), cc*sc)

	b.ResetTimer()

	for i := 0; i < b.N; i++ {
		temperature.Compute(P, sc)
	}
}
{'fraction_non_alphanumeric': 0.17553559087767795, 'fraction_numerical': 0.0359364201796821, 'mean_word_length': 4.246376811594203, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3732909', 'n_tokens_mistral': 633, 'n_tokens_neox': 570, 'n_words': 113}