Avatar for the tortoise user
tortoise
tortoise-orm
BlogDocsChangelog

feat: Add prepared/compiled/cached parametrized queries

#2131
Comparing
RuslanUC:feat/add-prepared-parametrized-queries
(
472f36e
) with
develop
(
15e3a94
)
CodSpeed Performance Gauge
0%
Untouched
24

Benchmarks

24 total
test_field_attribute_lookup_get_for_dialect
tests/benchmarks/test_field_attribute_lookup.py
CodSpeed Performance Gauge
+1%
59.7 µs59.1 µs
test_hydrate_100_rows_many_fields
tests/benchmarks/test_hydration.py
CodSpeed Performance Gauge
0%
17.1 ms17 ms
test_expressions_count
tests/benchmarks/test_expressions.py
CodSpeed Performance Gauge
0%
851.6 µs849.7 µs
test_get_many_fields
tests/benchmarks/test_get.py
CodSpeed Performance Gauge
0%
1.1 ms1.1 ms
test_create_few_fields
tests/benchmarks/test_create.py
CodSpeed Performance Gauge
0%
456.1 µs455.5 µs
test_hydrate_100_rows_few_fields
tests/benchmarks/test_hydration.py
CodSpeed Performance Gauge
0%
4 ms4 ms
test_values_100_rows_many_fields
tests/benchmarks/test_hydration.py
CodSpeed Performance Gauge
0%
3 ms3 ms
test_expressions_f
tests/benchmarks/test_expressions.py
CodSpeed Performance Gauge
0%
755.8 µs756.2 µs
test_get_few_fields
tests/benchmarks/test_get.py
CodSpeed Performance Gauge
0%
736.8 µs737.6 µs
test_filter_few_fields
tests/benchmarks/test_filter.py
CodSpeed Performance Gauge
0%
1 ms1 ms
test_state_building_200_models
tests/benchmarks/test_state_building.py
CodSpeed Performance Gauge
0%
457 ms457.7 ms
test_bulk_create_few_fields
tests/benchmarks/test_bulk_create.py
CodSpeed Performance Gauge
0%
2.6 ms2.6 ms
test_update_many_fields_with_update
tests/benchmarks/test_update.py
CodSpeed Performance Gauge
0%
904 µs906.3 µs
test_bulk_create_many_fields
tests/benchmarks/test_bulk_create.py
CodSpeed Performance Gauge
0%
10.2 ms10.3 ms
test_filter_many_filters
tests/benchmarks/test_filter.py
CodSpeed Performance Gauge
0%
3 ms3 ms
test_create_many_fields
tests/benchmarks/test_create.py
CodSpeed Performance Gauge
0%
701.8 µs704.9 µs
test_constructor_100_many_defaults
tests/benchmarks/test_hydration.py
CodSpeed Performance Gauge
-1%
33.4 ms33.6 ms
test_chained_filters_10
tests/benchmarks/test_hydration.py
CodSpeed Performance Gauge
-1%
5.2 ms5.3 ms
test_update_few_fields_with_save
tests/benchmarks/test_update.py
CodSpeed Performance Gauge
-1%
397 µs400 µs
test_update_few_fields_with_update
tests/benchmarks/test_update.py
CodSpeed Performance Gauge
-1%
727.1 µs733.2 µs
test_values_list_100_rows
tests/benchmarks/test_hydration.py
CodSpeed Performance Gauge
-1%
1.5 ms1.5 ms
test_update_many_fields_with_save
tests/benchmarks/test_update.py
CodSpeed Performance Gauge
-2%
524.8 µs535.3 µs

Commits

Click on a commit to change the comparison range
Base
develop
15e3a94
-0.12%
fix return type of PreparedQuerySetSingle.execute
bf411ee
23 days ago
by RuslanUC
+0.05%
Merge branch 'develop' into feat/add-prepared-parametrized-queries
65acb11
21 days ago
by RuslanUC
+0.08%
use QuerySet methods for creating queries in .values_list, .values, .update, .delete, .count, .exists
6c08eb0
21 days ago
by RuslanUC
-0.08%
fix style issue in test_prepared_query_get_sql;
69311e1
20 days ago
by RuslanUC
-0.15%
return PreparedDeleteQuery from _PreparedQueryMixin.delete instead of DeleteQuery
0da28ce
20 days ago
by RuslanUC
+0.29%
fix style and typing issues
4ae9004
20 days ago
by RuslanUC
+0.02%
type single CompiledQuerySet, CompiledValuesListQuery and CompiledValuesQuery
dd3bbcb
20 days ago
by RuslanUC
+0.03%
add lru cache for queries that contain collections
e82a4be
20 days ago
by RuslanUC
-0.07%
set _db to None when cloning compiled queries
839970a
20 days ago
by RuslanUC
+0.02%
copy _sql_cache_maxsize and _dynamic_params_init when cloning compiled queries
ebd33cb
20 days ago
by RuslanUC
-0.28%
fix compiled queries using model object when filtering by foreign key instead of model pk
7fc32eb
16 days ago
by RuslanUC
-0.01%
raise error if compiled parameters are not provided
e6af426
15 days ago
by RuslanUC
+0.06%
don't store collection param name in sql cache, only length
513e321
15 days ago
by RuslanUC
-0.11%
turn CollectionParameter into Criterion and generate 1=1 or 1=0 if provided parameter is empty (mirror `filters.is_in` and `filters.not_in` behaviour)
472f36e
11 days ago
by RuslanUC
© 2026 CodSpeed Technology
Home Terms Privacy Docs