<commit_before>package gson

import "sync"

// MaxStringLen maximum length of string value insdie json document.
const MaxStringLen = 1024 * 1024

// MaxCollateLen maximum length of collated value.
const MaxCollateLen = 1024 * 1024

type memConfig struct {
	strlen  int // maximum length of string value inside JSON document
	numkeys int // maximum number of keys that a property object can have
	itemlen int // maximum length of collated value.
	ptrlen  int // maximum length of json-pointer can take
}

type mempools struct {
	prefixPool *sync.Pool // maximum length of json pointer
	stringPool *sync.Pool // scratch pad for string objects
	keysPool   *sync.Pool // property keys
	keypool    *sync.Pool
	codepool   *sync.Pool
}

func newMempool(strlen, numkeys, itemlen, jptrlen int) mempools {
	m := mempools{}
	m.prefixPool = &sync.Pool{
		New: func() interface{} { return make([]byte, 0, jptrlen) },
	}
	m.stringPool = &sync.Pool{
		New: func() interface{} { return make([]byte, strlen) },
	}
	m.keysPool = &sync.Pool{
		New: func() interface{} { return make([]string, 0, numkeys) },
	}
	m.keypool = &sync.Pool{
		New: func() interface{} { return make(kvrefs, numkeys) },
	}
	m.codepool = &sync.Pool{
		New: func() interface{} { return make([]byte, itemlen) },
	}
	return m
}
<commit_msg>cosmetics.<commit_after>package gson

import "sync"

// MaxStringLen maximum length of string value insdie json document.
const MaxStringLen = 1024 * 1024

// MaxCollateLen maximum length of collated value.
const MaxCollateLen = 1024 * 1024

type memConfig struct {
	strlen  int // maximum length of string value inside JSON document
	numkeys int // maximum number of keys that a property object can have
	itemlen int // maximum length of collated value.
	ptrlen  int // maximum length of json-pointer can take
}

type mempools struct {
	prefixPool *sync.Pool // for computing list of possible pointers
	stringPool *sync.Pool
	keysPool   *sync.Pool
	keypool    *sync.Pool
	codepool   *sync.Pool
}

func newMempool(strlen, numkeys, itemlen, jptrlen int) mempools {
	m := mempools{}
	m.prefixPool = &sync.Pool{
		New: func() interface{} { return make([]byte, 0, jptrlen) },
	}
	m.stringPool = &sync.Pool{
		New: func() interface{} { return make([]byte, strlen) },
	}
	m.keysPool = &sync.Pool{
		New: func() interface{} { return make([]string, 0, numkeys) },
	}
	m.keypool = &sync.Pool{
		New: func() interface{} { return make(kvrefs, numkeys) },
	}
	m.codepool = &sync.Pool{
		New: func() interface{} { return make([]byte, itemlen) },
	}
	return m
}

{'fraction_non_alphanumeric': 0.11767020857929948, 'fraction_numerical': 0.014167650531286895, 'mean_word_length': 3.832699619771863, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6728625', 'n_tokens_mistral': 870, 'n_tokens_neox': 821, 'n_words': 284}