<reponame>tgodzik/intellij-community<filename>python/helpers/pydev/pydev_tests_python/resources/_performance_2.py
import time
import sys
import itertools

try:
    xrange  # @UndefinedVariable
except NameError:
    xrange = range
    
from itertools import groupby
count = itertools.count(0)
def next_val():
    return next(count) % 25

start_time = time.time()
letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

# create an array of random strings of 40 characters each
l = sorted([''.join([letters[next_val()] for _ in range(40)]) for _ in xrange(10000)])
# group by the first two characters
g = {k: list(v) for k, v in groupby(l, lambda x: x[:2])}


if False:
    pass  # Breakpoint here

print('TotalTime>>%s<<' % (time.time()-start_time,))
print('TEST SUCEEDED')
import time
import sys
import itertools

try:
    xrange  # @UndefinedVariable
except NameError:
    xrange = range
    
from itertools import groupby
count = itertools.count(0)
def next_val():
    return next(count) % 25

start_time = time.time()
letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

# create an array of random strings of 40 characters each
l = sorted([''.join([letters[next_val()] for _ in range(40)]) for _ in xrange(10000)])
# group by the first two characters
g = {k: list(v) for k, v in groupby(l, lambda x: x[:2])}


if False:
    pass  # Breakpoint here

print('TotalTime>>%s<<' % (time.time()-start_time,))
print('TEST SUCEEDED')
# @UndefinedVariable # create an array of random strings of 40 characters each # group by the first two characters # Breakpoint here