1
votes

I've been changing my deployment processes to use Phing rather than typical FTP/SCP upload of files.

However I'm having an issue with Phing being very slow. Copying a not very large file structure takes way longer than command line tools would. So does tar bzip2 and other tasks.

I do have PHP Xdebug turned on, but surely that won't cause it. Turning Xdebug off made no difference. I am running Phing via PhpStorm. Any ideas on how to speed up Phing?

1
Interestingly on another machine the same phing script has run in seconds. So it's something about my machine, but I don't know what. - David Findlay
Run it outside of PhpStorm -- any difference? P.S. Xdebug should not make huge difference here. Surely, xdebug slows down execution of PHP code (lets say 1.5 times) ... but there is not so much actual PHP code that CPU bound here. - LazyOne
I did try it outside of PhpStorm, from the command line after closing PhpStorm. There appeared to be no difference. - David Findlay
Try "freshen up" your PHP installation: 1) get newer version (v7.0.x at very least in case if you are still on v5.x); 2) try configuring it from scratch (php.ini -- try disabling unwanted extensions etc). P.S. Maybe it's your hardware/software (I mean -- old or fragmented HDD; network latency, anivirus...). No better ideas right now. - LazyOne

1 Answers

0
votes

So turns out I was barking up the wrong tree.

The problem was my Phing build was recursing. My build directory was within a directory getting copied and tar.bz2'd by phing. So each time I ran it there was another copy of my entire site recursively getting added to the build directory. This meant there were way too many files compared to what there should have been. It was also eating my hard drive and I was wondering why. It should have been obvious.

Here's what I've added as my first task to all build processes:

<!-- ============================================  -->
<!-- Target: clean                                 -->
<!-- ============================================  -->
<target name="clean">
    <echo msg="Cleaning ./build" />
    <delete dir="./build" includeemptydirs="true" failonerror="false" />
</target>

That's been added as a dependency to my first process. So there was nothing wrong with my environment, it was just Phing doing exactly what I told it to do.