

def bench1(n):
    'Benchmark Key comparison and hashing.'
    a = key.Key('Foo', 42, 'Bar', 1, 'Hopla', 'lala')
    b = key.Key('Foo', 42, 'Bar', 1, 'Hopla', 'lala')
    assert (a is not b)
    assert (a == b)
    for _ in xrange(n):
        (a == b)
        hash(a)

dataset/ETHPy150Open GoogleCloudPlatform/datastore-ndb-python/tests/keybench.py bench1/original