Skip to content

Commit

Permalink
DOC Performance improvements for changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Aug 28, 2023
1 parent 5b9afdd commit f590481
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion en/04_Changelogs/5.1.0.md
Expand Up @@ -65,12 +65,18 @@ foreach ($teams as $team) {
}
```

In a test setup with looping through 100 DataObjects each with 100 related DataObjects for a total of 10,000 records per test run, the following performance improvements were observed for different types of relations (eager-loading vs not eager-loading):
- HasOne - 3227% faster (0.0078s vs 0.2595s)
- HasMany - 25% faster (0.1453s vs 0.1819s)
- ManyMany - 25% faster (0.1664s vs 0.2083s)
- ManyManyThrough - 16% faster (0.6586s vs 0.7681s)

Read more about [eager loading](/developer_guides/model/relations/#eager-loading) including its limitations in the developer docs.

### Improvement to page search performance with Elemental {#cms-search-performance}

- The CMS search has been optimised to reduce the number of database queries made when searching for pages with elemental content blocks. This has resulted in a small performance improvement. In our test environment, with 1,000 pages each with 5 content blocks we observed a 9% performance improvement. Performance will vary with your environment.
- A new opt-in behaviour is available that makes a very large difference to performance when using elemental content blocks. In testing, this behaviour more than halved the response time of the sitetree search request. The opt-in feature disables the default behaviour of rendering all content blocks for CMS search. Instead, it simply extracts the database contents of the elements from its text and html fields. There is a downside to consider which is that any related content not directly on the element will not be matched against the search query. Note this does not use the `$searchable_fields` config. To opt-in to this behaviour, use the following config:
- A new opt-in behaviour is available that makes a very large difference to performance when using elemental content blocks. In testing, this behaviour was more than 100% faster (i.e. halving the response time) of the sitetree search request. The opt-in feature disables the default behaviour of rendering all content blocks for CMS search. Instead, it simply extracts the database contents of the elements from its text and html fields. There is a downside to consider which is that any related content not directly on the element will not be matched against the search query. Note this does not use the `$searchable_fields` config. To opt-in to this behaviour, use the following config:

```yml
DNADesign\Elemental\Controllers\ElementSiteTreeFilterSearch:
Expand Down Expand Up @@ -108,6 +114,13 @@ SilverStripe\ORM\DataList:
use_placeholders_for_integer_ids: true
```

The following performance improvements were measured in a test setup where 10,000 record IDs were passed in:
- DataList::byIDs() - 198% faster - (0.0608s vs 0.1812s)
- RelationList::foreignIDFilter()
- HasManyList::foreignIDFilter() - 108% faster (0.1584s vs 0.3304s)
- ManyManyList::foreignIDFilter() - 108% faster (0.1529s vs 0.3119s)
- ManyManyThroughList::foreignIDFilter() - 27% faster (0.6901s vs (0.8766s)

### Session manager anonymize stored IP addresses {#session-manager-ip}

A configuration option has been added to [Session Manager](https://github.com/silverstripe/silverstripe-session-manager/) to anonymize stored IP addresses for enhanced privacy and compliance.
Expand Down

0 comments on commit f590481

Please sign in to comment.