def METHOD_NAME(db, results, nrep, compress, data, detailed, minimize, threadno=None):
    for j in range(nrep):
        for r in 1, 10, 100, 1000:
            t = time.time()
            conflicts = 0
            jar = db.open()
            while 1:
                try:
                    transaction.begin()
                    rt = jar.root()
                    key = 's%s' % r
                    if key in rt:
                        p = rt[key]
                    else:
                        rt[key] = p = P()
                    for i in range(r):
                        v = getattr(p, str(i), P())
                        if compress is not None:
                            v.d = compress(data)
                        else:
                            v.d = data
                        setattr(p, str(i), v)
                    transaction.commit()
                except ConflictError:
                    conflicts = conflicts + 1
                else:
                    break
            jar.close()
            t = time.time() - t
            if detailed:
                if threadno is None:
                    print("%s\t%s\t%.4f\t%d" % (j, r, t, conflicts))
                else:
                    print("%s\t%s\t%.4f\t%d\t%d" % (j, r, t, conflicts,
                                                    threadno))
            results[r].append((t, conflicts))
            rt = p = v = None  # release all references
            if minimize:
                time.sleep(3)
                jar.cacheMinimize()