Change record status: 
Project: 
Introduced in branch: 
9.3.x
Introduced in version: 
9.3.0-alpha1
Description: 

Cache tags and contexts were always sorted regardless of usage, in order to make debugging and testing more convenient, however this added a performance burden to every HTML request.

In general this will not affect any runtime code at all, however some tests may need to account for differently sorted tags/contexts, in most cases the change will look like the following:

Before:

  $this->assertEquals($expected_top_level_contexts, $element['#cache']['contexts'], 'Expected cache contexts found.');

After:

    $this->assertEqualsCanonicalizing($expected_top_level_contexts, $element['#cache']['contexts'], 'Expected cache contexts found.');
Impacts: 
Module developers