<commit_before><commit_msg>Adding bounds test performance utility.<commit_after>package ar.app;

import java.io.File;
import java.io.FilenameFilter;

import ar.GlyphSet;
import ar.glyphsets.*;

public class BoundsSpeedTest {
	public static void main(String[] args) throws Exception {
		int iterations = args.length >0 ? Integer.parseInt(args[0]) : 10;
		File root = new File("./data/");
		File[] files = root.listFiles(new FilenameFilter(){
			public boolean accept(File dir, String name) {
				return name.toUpperCase().endsWith(".HBIN");
			}
		});
		
		for (File source: files) {
			long total=0;
			try {
			for (int i=0; i<iterations; i++) {
				GlyphSet glyphs = new MemMapList(source, .1d, new Painter.Constant<Double>());
				long start = System.currentTimeMillis();
				glyphs.bounds();
				long end = System.currentTimeMillis();
				total += (end-start);
			}
			System.out.printf("\t\t%s (avg), %s\n",source.getName(), total/((double) iterations));
			} catch (Exception e) {System.out.println("Error testing " + source.getName()); e.printStackTrace();}
		}		
	}
}
{'fraction_non_alphanumeric': 0.15813953488372093, 'fraction_numerical': 0.0065116279069767444, 'mean_word_length': 4.004651162790697, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6606989', 'n_tokens_mistral': 394, 'n_tokens_neox': 343, 'n_words': 86}