<commit_before>#!/usr/bin/env python
# -*- coding: utf8 -*-

import unittest
from random import shuffle
from timeit import Timer

import six
from six.moves import range

import agate


class TestTableJoin(unittest.TestCase):
    def test_join(self):
        left_rows = [(six.text_type(i), i) for i in range(100000)]
        right_rows = [(six.text_type(i), i) for i in range(100000)]

        shuffle(left_rows)
        shuffle(right_rows)

        column_names = ['text', 'number']
        column_types = [agate.Text(), agate.Number()]

        left = agate.Table(left_rows, column_names, column_types)
        right = agate.Table(right_rows, column_names, column_types)

        def test():
            left.join(right, 'text')

        results = Timer(test).repeat(10, 1)

        min_time = min(results)

        self.assertLess(min_time, 4)  # 4 for CI<commit_msg>test: Relax performance for CI (again)<commit_after>#!/usr/bin/env python
# -*- coding: utf8 -*-

import unittest
from random import shuffle
from timeit import Timer

import six
from six.moves import range

import agate


class TestTableJoin(unittest.TestCase):
    def test_join(self):
        left_rows = [(six.text_type(i), i) for i in range(100000)]
        right_rows = [(six.text_type(i), i) for i in range(100000)]

        shuffle(left_rows)
        shuffle(right_rows)

        column_names = ['text', 'number']
        column_types = [agate.Text(), agate.Number()]

        left = agate.Table(left_rows, column_names, column_types)
        right = agate.Table(right_rows, column_names, column_types)

        def test():
            left.join(right, 'text')

        results = Timer(test).repeat(10, 1)

        min_time = min(results)

        self.assertLess(min_time, 10)  # CI unreliable, 5 witnessed
{'fraction_non_alphanumeric': 0.11883408071748879, 'fraction_numerical': 0.020739910313901346, 'mean_word_length': 2.923076923076923, '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': '7452527', 'n_tokens_mistral': 620, 'n_tokens_neox': 558, 'n_words': 145}