MCPcopy
hub / github.com/ormar-orm/ormar / create

Function create

benchmarks/test_benchmark_create.py:14–22  ·  view source on GitHub ↗
(num_models: int)

Source from the content-addressed store, hash-verified

12async def test_creating_models_individually(aio_benchmark, num_models: int):
13 @aio_benchmark
14 async def create(num_models: int):
15 authors = []
16 for idx in range(0, num_models):
17 author = await Author.objects.create(
18 name="".join(random.sample(string.ascii_letters, 5)),
19 score=int(random.random() * 100),
20 )
21 authors.append(author)
22 return authors
23
24 authors = create(num_models)
25 for author in authors:

Callers 1

Calls 3

sampleMethod · 0.80
appendMethod · 0.80
createMethod · 0.45

Tested by

no test coverage detected