Performance optimizations #480
No reviewers
Labels
No labels
Security
TeX
auto-update
board
done
board
ready
board
todo
check
delete-eslint-rc-js
check
update-builddeps-package-json
check
update-eslint-rc-js
check
update-gitignore
check
update-merge-request-template
check
update-prettier-ignore
check
update-pyproject-toml
check
update-renovate-json
check
update-tox-ini
part
backend
part
ci
part
docs
part
frontend
part
i18n
part
non-technical
part
packaging
prio
1
prio
2
prio
3
release-mr-5.x
size
large
size
medium
size
small
source
customer
source
customer::fsmw
source
customer::fss
source
customer::teckids
source
downstream
type
breaking
type
bug
type
feature
type
refactoring
workflow
blocked
workflow
confirmed
workflow
current-todo
workflow
discussing
workflow
new-app
workflow
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
aleksis/AlekSIS-App-Alsijil!480
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/performance-optimizations"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Close #107
changed milestone to %2
changed the description
added 5 commits
mastere9282bc9- Merge branch 'master' into 73-add-rules-and-permissions45330d48- Simplify queryset in RegisterAbsenceForm78772300- Merge branch '73-add-rules-and-permissions' into feature/performance-optimizationsCompare with previous version
added 1 commit
ea8239e3- Reorder permission rules in order to make them more efficientCompare with previous version
added 1 commit
f56f70a5- Optimize has_person_group_object_permCompare with previous version
marked as a Work In Progress
added 1 commit
Compare with previous version
added 1 commit
32ef21a6- Optimize performance of predicates with custom permission queriesCompare with previous version
added 1 commit
24ef1e73- Simplify queriesCompare with previous version
added 1 commit
50459916- Rewrite some rules more efficientCompare with previous version
added 1 commit
940687dc- Convert queries to listsCompare with previous version
added 1 commit
cbe2050b- Optimize model extensionsCompare with previous version
added 3 commits
eb2f42e7- Prefetch form select data707cf04f- Use get_content_type_by_perm in predicates3b8503d8- ReformatCompare with previous version
added 1 commit
b62a14d2- Remove wrong set prefetchCompare with previous version
added 1 commit
66071535- Filter prefetched personal notesCompare with previous version
added 2 commits
e7b8690c- Simplify some queriesabbd2ccd- Add prefetch option in week viewCompare with previous version
added 6 commits
master120193ca- Merge branch 'master' into 73-add-rules-and-permissionscff25c97- Add permissions for "My groups"50629966- Merge branch '73-add-rules-and-permissions' into feature/performance-optimizationsCompare with previous version
added 2 commits
34ef43d1- Add menu validator for "My groups"6e333849- Merge branch '73-add-rules-and-permissions' into feature/performance-optimizationsCompare with previous version
added 6 commits
mastered1fede6- Merge branch 'master' into 73-add-rules-and-permissions82107ae6- Merge branch '73-add-rules-and-permissions' into feature/performance-optimizationsCompare with previous version
added 3 commits
ee72ebc2- Fix problems with update_or_create and prefetching091caa94- Merge branch 'fix/update-or-create' into 73-add-rules-and-permissions9d51bbfb- Merge branch '73-add-rules-and-permissions' into feature/performance-optimizationsCompare with previous version
added 1 commit
56806b7f- Use classproperty from functionalCompare with previous version
added 12 commits
masterc32c3d04- Merge branch 'master' into feature/performance-optimizationsCompare with previous version
changed the description
Please review, @nik!
unmarked as a Work In Progress
The last comma here reads like a syntax error.
Also, what is this good for?
Are you sure using a loop will improve performance?
But it isn't a syntax error and it's formatted in this way by black.
Ok, I will rename it. It should centralize access on these common-used models with a low count of entries, so that the results can be cached.
It definitely reduces database queries, because the values used by the loop are prefetched. The reduced count of database queries beats the time a Python loop needs.
I do not see how this reduces database queries.
Have you researched what others do to cache querysets?
We might want https://github.com/noripyt/django-cachalot
Filterdoesn't make use of prefetched values in related querysets,alldoes.Yes, but it's always a decision between a) we cache everything or b) we cache nothing. So that change here should be seen only as a workaround.
Yes, but then in core.
created #116 to continue this discussion
mentioned in issue #116
added 29 commits
master4e460d55- Merge branch 'master' into feature/performance-optimizationsCompare with previous version
Decided to use cachalot and "cache everything", so please remove all these workaround propertes from this MR.
Please remove in favour of cachalot.
Please use a
filter()for readability (and to account for any improvements on theRelatedManagerfilter API in spe).Please remove in favour of cachalot.
Please remove in favour of cachalot.
Please us a
filter(), as discussed above.resolved all threads
resolved all threads
changed this line in version 23 of the diff
changed this line in version 23 of the diff
changed this line in version 23 of the diff
changed this line in version 23 of the diff
changed this line in version 23 of the diff
added 3 commits
8e6c9320- Remove legacy caching methods29b5aa3a- Use filter in favour of for loops7d767261- ReformatCompare with previous version
mentioned in commit
1ed6789523