<commit_before>package hamt_test

import (
	"log"
	"math/rand"
	"testing"
	"time"
)

func BenchmarkMapGet(b *testing.B) {
	log.Printf("BenchmarkMapGet: b.N=%d", b.N)

	for i := 0; i < b.N; i++ {
		var j = int(rand.Int31()) % numHugeKvs
		var s = keyStrings[j]
		var val, ok = LookupMap[s]
		if !ok {
			b.Fatalf("LookupMap[%s] not ok", s)
		}
		if val != j {
			b.Fatalf("val,%v != %v", val, j)
		}
	}
}

func BenchmarkMapPut(b *testing.B) {
	log.Printf("BenchmarkMapPut: b.N=%d", b.N)

	var m = make(map[string]int, b.N)
	var s = "aaa"
	for i := 0; i < b.N; i++ {
		m[s] = i<commit_msg>moved rebuildDeleteMap() into map_test.go<commit_after>package hamt_test

import (
	"log"
	"math/rand"
	"testing"
	"time"
)

func rebuildDeleteMap(strs []string) {
	for val, str := range strs {
		_, exists := DeleteMap[str]
		if exists {
			break
		}

		DeleteMap[str] = val
	}
}

func BenchmarkMapGet(b *testing.B) {
	log.Printf("BenchmarkMapGet: b.N=%d", b.N)

	for i := 0; i < b.N; i++ {
		var j = int(rand.Int31()) % numHugeKvs
		var s = keyStrings[j]
		var val, ok = LookupMap[s]
		if !ok {
			b.Fatalf("LookupMap[%s] not ok", s)
		}
		if val != j {
			b.Fatalf("val,%v != %v", val, j)
		}
	}
}

func BenchmarkMapPut(b *testing.B) {
	log.Printf("BenchmarkMapPut: b.N=%d", b.N)

	var m = make(map[string]int, b.N)
	var s = "aaa"
	for i := 0; i < b.N; i++ {
		m[s] = i
{'fraction_non_alphanumeric': 0.1958762886597938, 'fraction_numerical': 0.005891016200294551, 'mean_word_length': 3.1559633027522938, 'pattern_counts': {'":': 0, '<': 7, '<?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': '4955517', 'n_tokens_mistral': 680, 'n_tokens_neox': 636, 'n_words': 145}