Skip to content

optimizations to improve performance, add optional ormar-utils packag…#1571

Draft
collerek wants to merge 9 commits intomasterfrom
check-optimisations-and-rs
Draft

optimizations to improve performance, add optional ormar-utils packag…#1571
collerek wants to merge 9 commits intomasterfrom
check-optimisations-and-rs

Conversation

@collerek
Copy link
Collaborator

…e written in rust

for group in grouped_instances.values():
model = cls._recursive_add(group)[0]
merged_rows.append(model)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function with high complexity (count = 9): merge_instances_list [qlty:function-complexity]

@collerek collerek force-pushed the check-optimisations-and-rs branch from 176ed3f to ae1db7c Compare February 27, 2026 13:57
if any("__" in x for x in children):
result_dict[key] = group_related_list(children)
else:
result_dict.setdefault(key, []).extend(children)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function with high complexity (count = 14): group_related_list [qlty:function-complexity]

new_val
]
else:
value_to_set.append(cur_field)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function with high complexity (count = 16): _merge_items_lists [qlty:function-complexity]

part=part, is_last=is_last, current_level=current_level
):
current_level[part] = dict()
elif part not in current_level:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deeply nested control flow (level = 4) [qlty:nested-control-flow]

current_level[part] = dict()
elif part not in current_level:
current_level[part] = def_val
current_level = current_level[part]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function with high complexity (count = 15): translate_list_to_dict [qlty:function-complexity]

@codecov
Copy link

codecov bot commented Feb 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (8340862) to head (17d9773).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##            master     #1571   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          216       216           
  Lines        15288     15226   -62     
=========================================
- Hits         15288     15226   -62     
Files with missing lines Coverage Δ
ormar/fields/parsers.py 100.00% <100.00%> (ø)
ormar/models/helpers/models.py 100.00% <100.00%> (ø)
ormar/models/mixins/excludable_mixin.py 100.00% <100.00%> (ø)
ormar/models/mixins/merge_mixin.py 100.00% <100.00%> (ø)
ormar/queryset/queries/prefetch_query.py 100.00% <100.00%> (ø)
ormar/queryset/utils.py 100.00% <100.00%> (ø)
...ests/test_databases/test_transaction_as_fixture.py 100.00% <ø> (ø)
...s/test_queries/test_selecting_subset_of_columns.py 100.00% <ø> (ø)
tests/test_queries/test_values_and_values_list.py 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 27, 2026

Merging this PR will degrade performance by 30.46%

⚡ 3 improved benchmarks
❌ 1 regressed benchmark
✅ 80 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation test_get_one[250] 2.7 ms 2.2 ms +25.76%
Simulation test_making_and_inserting_models_in_bulk[10] 6.2 ms 4.9 ms +26.2%
Simulation test_get_or_create_when_get[250] 3.8 ms 2.9 ms +33.1%
Simulation test_sum[250] 3 ms 4.3 ms -30.46%

Comparing check-optimisations-and-rs (17d9773) with master (8340862)1

Open in CodSpeed

Footnotes

  1. No successful run was found on master (fa59cdf) during the generation of this report, so 8340862 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant