def benchmark ( store , n = 10000 ) : R = Referrer for referred in store . query ( Referred ) : for _reference in store . query ( R , R . reference == referred ) : pass
how to control number of iterations in ref python
Iterates over all of the referreds and then iterates over all of the referrers that refer to each one .
def benchmark(store, n=10000):
    """
    Iterates over all of the referreds, and then iterates over all of the
    referrers that refer to each one.

    Fairly item instantiation heavy.
    """
    R = Referrer

    for referred in store.query(Referred):
        for _reference in store.query(R, R.reference == referred):
            pass