<commit_before>(function() {

	var numbers = [];
	for (var i=0; i<1000; i++) numbers.push((Math.random() * (1000*i)));
	var strings = $.map(numbers, function(num){ return accounting.formatMoney(num*1000, "HK$ "); });

	JSLitmus.test('unformat()', function(count) {
		var i = 0;
		while ( count-- ) {
			accounting.unformat(strings[i])
			i++;
			i > strings.length && (i = 0);
		}
	});

	JSLitmus.test('toFixed()', function(count) {
		while ( count-- ) {
			accounting.toFixed(count*1000, 2);
		}
	});

	JSLitmus.test('formatNumber()', function(count) {
		var i = 0;
		while ( count-- ) {
			accounting.formatNumber(numbers[i]);
			i++;
			i > numbers.length && (i = 0);
		}
	});

	JSLitmus.test('formatMoney()', function(count) {
		var i = 0;
		while ( count-- ) {
			accounting.formatMoney(numbers[i]);
			i++;
			i > numbers.length && (i = 0);
		}
	});

	JSLitmus.test('formatColumn()', function(count) {
		var i = 0;
		while ( count-- ) {
			accounting.formatColumn([numbers[i], numbers[i+1]]);
			i += 2;
			i > numbers.length && (i = 0);
		}
	});

})();<commit_msg>add speed test for operations over arrays<commit_after>(function() {

	var numbers = [];
	for (var i=0; i<1000; i++) numbers.push((Math.random() * (1000*i)));
	var strings = $.map(numbers, function(num){ return accounting.formatMoney(num*1000, "HK$ "); });

	JSLitmus.test('unformat()', function(count) {
		var i = 0;
		while ( count-- ) {
			accounting.unformat(strings[i])
			i++;
			i > strings.length && (i = 0);
		}
	});

	JSLitmus.test('unformat() - array', function(count) {
		while ( count-- ) {
			accounting.unformat(strings);
        }
	});

	JSLitmus.test('toFixed()', function(count) {
		while ( count-- ) {
			accounting.toFixed(count*1000, 2);
		}
	});

	JSLitmus.test('formatNumber()', function(count) {
		var i = 0;
		while ( count-- ) {
			accounting.formatNumber(numbers[i]);
			i++;
			i > numbers.length && (i = 0);
		}
	});

	JSLitmus.test('formatNumber() - array', function(count) {
		while ( count-- ) {
            accounting.formatNumber(numbers);
        }
	});

	JSLitmus.test('formatMoney()', function(count) {
		var i = 0;
		while ( count-- ) {
			accounting.formatMoney(numbers[i]);
			i++;
			i > numbers.length && (i = 0);
		}
	});

	JSLitmus.test('formatMoney() - array', function(count) {
		while ( count-- ) {
			accounting.formatMoney(numbers);
        }
	});

	JSLitmus.test('formatColumn()', function(count) {
		var i = 0;
		while ( count-- ) {
			accounting.formatColumn([numbers[i], numbers[i+1]]);
			i += 2;
			i > numbers.length && (i = 0);
		}
	});

})();
{'fraction_non_alphanumeric': 0.21392454297938546, 'fraction_numerical': 0.021781408012446518, 'mean_word_length': 3.216393442622951, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '6499101', 'n_tokens_mistral': 1116, 'n_tokens_neox': 950, 'n_words': 178}