Looking for group files can be really slow #4025

Merged
merged 2 commits into from Mar 7, 2017

Conversation

Projects
None yet
4 participants
@pitpit
Contributor

pitpit commented Feb 21, 2017

This is caused by use of Finder::path() at https://github.com/Codeception/Codeception/blob/2.2/src/Codeception/Lib/GroupManager.php#L43-L47 when groups parameter is set in codeception.yml

Finder is referencing every files in project root dir, then filters them according to string passed to path(). If a lot of files stand in project root dir, it can takes more than 2minutes to find a few group files.

Here's a patch to get rid of Finder::path(). It reduces elapsed time from several minutes to few seconds.

@pitpit

This comment has been minimized.

Show comment
Hide comment
@pitpit

pitpit Feb 21, 2017

Contributor

testing fails on https://github.com/Codeception/Codeception/blob/2.2/tests/unit/Codeception/Module/PhpBrowserTest.php#L28. It is not related to code in this PR
Guzzle seems to not support request URL without starting slash anymore.

Contributor

pitpit commented Feb 21, 2017

testing fails on https://github.com/Codeception/Codeception/blob/2.2/tests/unit/Codeception/Module/PhpBrowserTest.php#L28. It is not related to code in this PR
Guzzle seems to not support request URL without starting slash anymore.

@Naktibalda

This comment has been minimized.

Show comment
Hide comment
Member

Naktibalda commented Feb 21, 2017

@Naktibalda

This comment has been minimized.

Show comment
Hide comment
@Naktibalda

Naktibalda Feb 22, 2017

Member

Please merge 2.2 branch to make the build pass.

Member

Naktibalda commented Feb 22, 2017

Please merge 2.2 branch to make the build pass.

Merge branch '2.2' of https://github.com/Codeception/Codeception into…
… bugfix/loadGroupsByPattern-too-slow
@pitpit

This comment has been minimized.

Show comment
Hide comment
@pitpit

pitpit Feb 23, 2017

Contributor

done

Contributor

pitpit commented Feb 23, 2017

done

@laupiFrpar

This comment has been minimized.

Show comment
Hide comment

+1

@Naktibalda Naktibalda requested a review from DavertMik Feb 24, 2017

@pitpit

This comment has been minimized.

Show comment
Hide comment
@pitpit

pitpit Mar 3, 2017

Contributor

If you could have a look on this, please

Contributor

pitpit commented Mar 3, 2017

If you could have a look on this, please

@DavertMik

This comment has been minimized.

Show comment
Hide comment
@DavertMik

DavertMik Mar 7, 2017

Member

Thank you for this performance improvement. Looks nice and elegant

Member

DavertMik commented Mar 7, 2017

Thank you for this performance improvement. Looks nice and elegant

@DavertMik DavertMik merged commit 91dbe4f into Codeception:2.2 Mar 7, 2017

4 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
semaphoreci The build passed on Semaphore.
Details
wercker/build Wercker pipeline passed
Details

chris1312 added a commit to chris1312/Codeception that referenced this pull request Jun 16, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment