Skip to content

A bunch of minor performance optimizations #16335

Merged
Migaroez merged 18 commits intov13/devfrom
v13/hotfix/performance-optimizations-based-on-eu-data
Jun 3, 2024
Merged

A bunch of minor performance optimizations #16335
Migaroez merged 18 commits intov13/devfrom
v13/hotfix/performance-optimizations-based-on-eu-data

Conversation

@bergmania
Copy link
Copy Markdown
Member

@bergmania bergmania commented May 21, 2024

Description

This PR contains a series of smaller performance improvements, found when working the a massive dataset.

  • Optimized ask for macros, when no one is found
    • This was an issue due to the unfriendly code pattern we have with GetAll methods that has to be used to with multiple parameters, but return everything when no parameters are provided.
  • Added a request cache to the permissions lookup.
    • This is required because the permissions are looked up for each language in the mappers to generate the view model for editing content.
  • Ensure the delivery API indexing happens in one scope to avoid n+1 lock request.
  • Combined two queries into a single to minimize latency when taking a lock.
  • Due to the fact the caches are mutable, the items are deepcloned before returned. So a small optimization is made to look up the content types needed in a block grid at once.
  • Added a district on userIds, when looking up names for creator for the indexing
  • Removed unused code in the mappers

bergmania and others added 18 commits April 15, 2024 10:55
…v13/hotfix/performance-optimizations-based-on-eu-data
…nce-optimizations-based-on-eu-data-kja-suggestions' into v13/hotfix/performance-optimizations-based-on-eu-data
…v13/hotfix/performance-optimizations-based-on-eu-data

# Conflicts:
#	version.json
…otfix/performance-optimizations-based-on-eu-data
@bergmania bergmania added category/performance Fixes for performance (generally cpu or memory) fixes category/notable release/13.4.0 labels May 29, 2024
IUserRepository userRepository,
IUserGroupRepository userGroupRepository,
IOptions<GlobalSettings> globalSettings,
IRequestCache requestCache)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't like that we have a requestCache in a entity service.

Think it would be better to do something like the BlockEditorElementTypeCache introduced in this PR to separate the caching behavior from the actual retrieval from persistance.

@Migaroez Migaroez merged commit 0aaac78 into v13/dev Jun 3, 2024
@Migaroez Migaroez deleted the v13/hotfix/performance-optimizations-based-on-eu-data branch June 3, 2024 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category/notable category/performance Fixes for performance (generally cpu or memory) fixes release/13.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants