def bench_field_full_init(): Timer(lambda: fields.field()('foo')).time(1E5)
def bench_field_get_value(): foo = fields.field()('foo') Timer(foo, {'foo': 'bar'}).time(1E5)
def bench_mapping_init(): Timer(fields.mapping(foo=fields.string(), bar=fields.integer())(), 'foobar').time(1E5)
def bench_field_init(): Timer(fields.field(), 'foo').time(1E5)
def bench_mapping_get_value(): foobar = fields.mapping(foo=fields.string(), bar=fields.integer())()('foobar') Timer(foobar, {'foobar': {'foo': 'bar', 'bar': '3'}}).time(1E5)
def bench_mapping_definition(): Timer(fields.mapping, foo=fields.string(), bar=fields.integer()).time(1E5)
def bench_record_create(): Timer(record(foo=fields.string(key=True), bar=fields.integer())).time(1E5)
def bench_record_full_init(): Timer(lambda: record(foo=fields.string(key=True), bar=fields.integer())() ('foo')).time(1E5)
def bench_record_nested(): foobar = record(foo=fields.string(key=True), bar=record(baz=fields.integer(key=True))())()('foobar') Timer(foobar, {'foo': 'bar', 'bar': {'baz': 1234}}).time(1E5)
def bench_record_definition(): Timer(record, foo=fields.string(key=True), bar=fields.integer()).time(1E5)
def bench_record_resolve_many(): foo = record(foo=fields.string(key=True), bar=fields.integer())(many=True)('foo') Timer(foo, [{'foo': 'bar', 'bar': 1234}]).time(1E5)
def bench_record_resolve_one(): foo = record(foo=fields.string(key=True), bar=fields.integer())()('foo') Timer(foo, {'foo': 'bar'}, {'foo': None}).time(1E5)
def bench_record_resolve_all(): foo = record(foo=fields.string(key=True), bar=fields.integer())()('foo') Timer(foo, {'foo': 'bar', 'bar': 1234}).time(1E5)
def bench_field_definition(): Timer(fields.field).time(1E5)
def bench_mapping_full_init(): Timer(lambda: fields.mapping(foo=fields.string(), bar=fields.integer())()('foobar')).time(1E5)
def bench_field_definition_with_params(): Timer(fields.field, key=True, cast=str).time(1E5)
def bench_record_init(): rec = record(foo=fields.string(key=True), bar=fields.integer())() Timer(rec, 'foo').time(1E5)