-
Notifications
You must be signed in to change notification settings - Fork 3
Steps to improve performance
WebActivatorEx was used by SPEAK to power startup code execution.
The price to pay is loading/inspecting the whole bin folder.
The Sitecore-way of executing code upon startup is initialize pipeline, and that what is done now.
Impact: Saves at least a few seconds:
Yes, assembly load time is minor. Do you want to be taxed a small amount each time, or prefer not to?
~300 minor timings together end up in a noticeable delay:
Compare timings Sitecore 7.2 (72 assemblies) vs 9.0 (338 assemblies):
If you do not use SOLR, MongoDB session state, why to keep the assemblies in the 'bin' folder?
Sitecore system items (core database) are expected have read workload - ratio of system update operations is miserable.
Sitecore reads item data by ItemID, thus introducing primary key for ItemID in core database will simplify its task = faster executions:
The query capable of adding clustered indexes:
CREATE UNIQUE CLUSTERED INDEX IX_ItemsID on Items(ID)
CREATE CLUSTERED INDEX IX_SharedFields_ItemID on SharedFields(ItemID)
CREATE CLUSTERED INDEX IX_UnversionedFields_ItemID on UnversionedFields(ItemID)
CREATE CLUSTERED INDEX IX_VersionedFields_ItemID on VersionedFields(ItemID)
Sitecore has the concept of system items that are to be used for every request processing, examples:
- Devices
- Layouts
- Templates
- Home
In order to prevent concurrent SQL requests, we'll execute them as 'initial' prefetch.
The list of items is defined in App_Config\Prefetch folder - reducing the count of entries impacts the initial prefetch speed = startup performance.
Every Sitecore item has a few system fields:
- created/created by
- updated/updated by
- revision
- owner
Over 95% versionedFields in core database belong to system technical debt query
:
Leaving only one versioned field (f.e. created time) will allow indicate item versions exist.
ASP.NET defines basic compilation settings as:
- OptimizeCompilations - well explained here and here
- Batch - compile a batch of pages instead of one link - pay more once vs pay less multiple times
While JIT gives a flexibility of moving code between platforms, it still needs to be converted into machine commands specific to the end machine:
Jitting Main assemblies brings us to