Problem/Motivation

We duplicated some logic from the Kernel test TaxonomyTermFilterDepthTest to the Functional test to prevent random test failures here: #3229665: \Drupal\Tests\taxonomy\Functional\Views\TaxonomyTermFilterDepthTest can randomly fail due to views sorts, but also found out it could be (micro-)optimized here #3229665-5: \Drupal\Tests\taxonomy\Functional\Views\TaxonomyTermFilterDepthTest can randomly fail due to views sorts

Steps to reproduce

Proposed resolution

Apply micro-optimisation on both Kernel and Functional Test

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#7 3229686-7.patch1.74 KBdww

Issue fork drupal-3229686

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Spokje created an issue. See original summary.

Spokje’s picture

Spokje’s picture

Title: Optimize logic in Kernel- and Functional-test of TaxonomyTermFilterDepthTest » [PP-1] Optimize logic in Kernel- and Functional-test of TaxonomyTermFilterDepthTest
Status: Active » Postponed
dww’s picture

Priority: Normal » Minor

Thanks for opening this. Definitely minor. ;)

Spokje’s picture

There will be a day that I'll open a new issue without doing 42 edits afterwards, also that day the universe will be replaced by something even more bizarre and inexplicable.

dww’s picture

Title: [PP-1] Optimize logic in Kernel- and Functional-test of TaxonomyTermFilterDepthTest » Optimize logic in Kernel- and Functional-test of TaxonomyTermFilterDepthTest
Status: Postponed » Active
dww’s picture

Assigned: Spokje » Unassigned
Status: Active » Needs review
FileSize
1.74 KB
Spokje’s picture

Status: Needs review » Reviewed & tested by the community

- Green TestBot
- Code consistently changed
- Micro-optimisation is going to be big in 2021 ;)

RTBC for me

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 4894881 and pushed to 9.3.x. Thanks!

Today I read...

          // Pre-increment is faster in PHP than increment.
          ++$blob_count;

In our code base. I think micro-optimisations have always been a big hit!

  • alexpott committed 4894881 on 9.3.x
    Issue #3229686 by Spokje, dww: Optimize logic in Kernel- and Functional-...
Spokje’s picture

You ++$knowledge every day...

dww’s picture

Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.