<commit_before>package com.almondtools.stringbench;

import java.util.List;
import java.util.concurrent.TimeUnit;

import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Fork;
import org.openjdk.jmh.annotations.Measurement;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OutputTimeUnit;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.Setup;
import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.annotations.TearDown;
import org.openjdk.jmh.annotations.Warmup;

@State(Scope.Thread)
public abstract class MultiPatternMatcherBenchmark {

	private MultiPatternSample sample;

	public abstract void prepare(String[] pattern);

	public abstract List<Integer> find(int i, String text);

	public abstract String getId();

	@Setup
	public void setup(MultiPatternSample sample) {
		this.sample = sample;
		prepare(sample.getPattern());
	}

	@Benchmark
	@BenchmarkMode(Mode.AverageTime)
	@OutputTimeUnit(TimeUnit.MILLISECONDS)
	@Warmup(iterations = 2)
	@Measurement(iterations = 2)
	@Fork(1)
	public void benchmarkPrepare() {
		prepare(sample.getPattern());
	}

	@Benchmark
	@BenchmarkMode(Mode.AverageTime)
	@OutputTimeUnit(TimeUnit.MILLISECONDS)
	@Warmup(iterations = 2)
	@Measurement(iterations = 2)
	@Fork(1)
	public void benchmarkFind() {
		for (int i = 0; i < sample.patterns(); i++) {
			List<Integer> result = find(i, sample.getSample(i));
			sample.validate(i, result);
		}
	}

	@TearDown
	public void tearDown() {
		this.sample = null;
	}

}<commit_msg>adjusting benchmark<commit_after>package com.almondtools.stringbench;

import java.util.List;
import java.util.concurrent.TimeUnit;

import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Fork;
import org.openjdk.jmh.annotations.Measurement;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OutputTimeUnit;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.Setup;
import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.annotations.TearDown;
import org.openjdk.jmh.annotations.Warmup;

@State(Scope.Thread)
public abstract class MultiPatternMatcherBenchmark {

	private MultiPatternSample sample;

	public abstract void prepare(String[] pattern);

	public abstract List<Integer> find(int i, String text);

	public abstract String getId();

	@Setup
	public void setup(MultiPatternSample sample) {
		this.sample = sample;
		prepare(sample.getPattern());
	}

	@Benchmark
	@BenchmarkMode(Mode.AverageTime)
	@OutputTimeUnit(TimeUnit.MILLISECONDS)
	@Warmup(iterations = 1)
	@Measurement(iterations = 2)
	@Fork(1)
	public void benchmarkPrepare() {
		prepare(sample.getPattern());
	}

	@Benchmark
	@BenchmarkMode(Mode.AverageTime)
	@OutputTimeUnit(TimeUnit.MILLISECONDS)
	@Warmup(iterations = 1)
	@Measurement(iterations = 2)
	@Fork(1)
	public void benchmarkFind() {
		for (int i = 0; i < sample.patterns(); i++) {
			List<Integer> result = find(i, sample.getSample(i));
			sample.validate(i, result);
		}
	}

	@TearDown
	public void tearDown() {
		this.sample = null;
	}

}
{'fraction_non_alphanumeric': 0.12047440699126093, 'fraction_numerical': 0.004369538077403246, 'mean_word_length': 5.621900826446281, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '984796', 'n_tokens_mistral': 1202, 'n_tokens_neox': 1123, 'n_words': 205}