Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Travis optimizations #7070

Closed
wants to merge 1 commit into from
Closed

Travis optimizations #7070

wants to merge 1 commit into from

Conversation

marc-mabe
Copy link
Member

  • disabled GC on running unit tests and cs fixer
  • allow to run more parallel processes than CPUs
  • ignore special folders ('_files' and 'AllTests') to run with phpunit
  • no longer keep order of parallel processes
    • this one isn't for all over performance but for humans - If you wait for a specific test case you will be informed asap the component has been ready

This should be make little performance improvements.

A much better performance improvement would be to run all unit tests and cs fixer in parallel, too.
But I currently haven't a good idea how to do that simplified.

 - disabled GC on running unit tests and cs fixer
 - allow to run more parallel processes than CPUs
 - ignore special folders ('_files' and 'AllTests') to run with phpunit
@Ocramius Ocramius added this to the 2.4.0 milestone Dec 22, 2014
@Ocramius Ocramius self-assigned this Dec 22, 2014
# Run coding standard checks in parallel
- ls -d library/Zend/* tests/ZendTest/* bin | parallel --gnu --keep-order 'echo "Running {} CS checks"; ./vendor/bin/php-cs-fixer fix {} -v --dry-run --config-file=.php_cs;' || exit 1
- ls -d library/Zend/* tests/ZendTest/* bin | parallel --gnu -P 0 'echo "Running {} CS checks"; php -d zend.enable_gc=0 ./vendor/bin/php-cs-fixer fix {} -v --dry-run --config-file=.php_cs;' || exit 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about HHVM?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ocramius What do you mean? The only PHP runtme difference is zend.enable_gc=0 and it will be ignored by HHVM.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it will be ignored then it's fine :)

@Ocramius Ocramius closed this in a98e789 Jan 8, 2015
Ocramius added a commit that referenced this pull request Jan 8, 2015
…ollection-disabled' into develop

Close #7070
Forward port #7070
@Ocramius
Copy link
Member

Ocramius commented Jan 8, 2015

Merged, thanks @marc-mabe!

master: a98e789
develop: 0f4e072

@Ocramius Ocramius modified the milestones: 2.3.4, 2.4.0 Jan 8, 2015
@Ocramius
Copy link
Member

Ocramius commented Jan 8, 2015

@marc-mabe
Copy link
Member Author

mh interesting - this error doesn't come up on my tests.
than let us remove the gc disabling

@Ocramius
Copy link
Member

Ocramius commented Jan 8, 2015

It only happens on develop: I assume a very slow test in Zend\Math is
involved

Marco Pivetta

http://twitter.com/Ocramius

http://ocramius.github.com/

On 8 January 2015 at 09:33, Marc Bennewitz notifications@github.com wrote:

mh interesting - this error doesn't come up on my tests.
than let us remove the gc disabling


Reply to this email directly or view it on GitHub
#7070 (comment).

@marc-mabe
Copy link
Member Author

It's on exporting tested results of Zend\Math and it has 312585 assertions.

@Ocramius
Copy link
Member

Ocramius commented Jan 8, 2015

Probably due to RNG tests... Those could be put in ignored coverage...

@marc-mabe
Copy link
Member Author

test coverage should not be ignored only because it's slow

@Ocramius
Copy link
Member

Ocramius commented Jan 9, 2015

@marc-mabe repeatedly stress-testing the same segment of code during a statistical benchmark isn't really useful for us (for the purpose of coverage)

@marc-mabe
Copy link
Member Author

the problem is that this test isn't only a stress test. It would be optimal to reduce the cycles for rnd stress test to be 1 to be a normal unit test.

EDIT: Doesn't work

@Ocramius
Copy link
Member

Ocramius commented Jan 9, 2015

@marc-mabe isn't @coversNothing on the single test that runs the stress-operations enough? Worth trying, imo

@marc-mabe
Copy link
Member Author

@Ocramius Good idea but even with @coversNothing the rnd test runs into out of memory with zend.enable_gc=0 and coverage enabled.

Results on running Math/RandTest.php on my machine:
gc off + coverage on = out of memory
gc off + coverage on + @coversNothing = out of memory
gc on + coverage on = 6.14 minutes, 9.75Mb
gc on + coverage on + @coversNothing = 6.06 minutes, 9.75Mb
gc off + coverage off = out of memory
gc on + coverage off = 49.73 seconds, 6.75Mb

So I think gc needs to be enabled on running phpunit and the biggest slow down is code coverage generation.

Btw. the cs fixer is ~ 1-5% faster with gc off

weierophinney pushed a commit to zendframework/zend-i18n-resources that referenced this pull request May 28, 2015
weierophinney pushed a commit to zendframework/zend-i18n-resources that referenced this pull request May 28, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants