U4-10026 - Core/Deploy Perfs issues with GetById(Guid key) methods

Created by Stephan 16 Jun 2017, 07:39:33 Updated by Shannon Deminick 20 Jun 2017, 07:03:20

Subtask of: U4-9609

Cloning / restoring a site w/2000 nodes and seeing perfs issues. Might be linked to Get(Guid key) in content service being slowish. Investigate.


Stephan 16 Jun 2017, 12:12:23

PR: https://github.com/umbraco/Umbraco-CMS/pull/2004

instead of doing Get by Guid hitting the DB everytime, we now use the internal id-key cache map that was only in EntityService. should be way faster.

also refactored that cache map so that it's cross-referencing (id to key and key to id) and is generally faster according to benchmarks.

also refactored how that cache map is cleared so that instead of clearing the whole of it every time, we only remove the impacted entries.

review: try to restore a remote site and see if there's a difference.

Shannon Deminick 20 Jun 2017, 01:07:27

Added comments to PR, we just need to inject the IdKMap to the services

Stephan 20 Jun 2017, 06:06:57

arh... obviously, but it's kinda a pain because the service ctors are all public and so that would break compat, which is why I haven't done it. Suggestions?

Shannon Deminick 20 Jun 2017, 06:13:31

Yes, but we've had this documented for years now: https://our.umbraco.org/Documentation/Development-Guidelines/breaking-changes#non-breaking

People cannot/should not be constructing these services in their website code. In the past we've created new service ctor overloads and obsoleted the old ones - which we can do for this too.

Stephan 20 Jun 2017, 06:16:35

k - fixing today

Stephan 20 Jun 2017, 06:55:24

pushed, up for review

Shannon Deminick 20 Jun 2017, 07:01:46

Looks good to me!

Priority: Normal

Type: Task

State: Fixed


Difficulty: Normal


Backwards Compatible: True

Fix Submitted:

Affected versions:

Due in version: 7.6.4

Sprint: Sprint 61

Story Points: