17452 Posts in 4473 Topics by 1971 members
|Go to End|
26 March 2008 at 8:02pm Last edited: 27 March 2008 9:38am
Hi there everyone -
Im currently in the process of having a go at speeding up the ManifestBuilder compiling process. Basically ive written a very early prototype of a new Manifest Builder, which id like to get some feedback and ideas for. Currently it reduces manifest build time by around a quarter (from 1.2 seconds to 0.9 seconds) on my local machine - id also appreciate it if some others would test it out.
Im also creating some PHPUnit tests to ensure that functionality remains the same across both builders.
To install, download the NewManifestBuilder.php file below, and copy it to your sapphire/core directory. Then open up main.php, and replace the line
and replace the lines
26 March 2008 at 8:03pm Last edited: 26 March 2008 9:59pm
(I forgot to click the upload button)
26 March 2008 at 10:28pm
To help get you started with the tests, I've committed a change to trunk
* I refactored ManifestBuilder to make it easier to test it. ManifestBuilder::get_manifest_info($baseDir) will generate an array of manifest information based on the SilverStripe site contained at $baseDir. By passing a fake test dir in this argument, you can construct
* I have made use of this in sapphire/tests/ManifestBuilderTest.php. The setUp() method iterates over a simple array structure to set up a set of test files in a temp folder, and passes this folder as the argument to get_manifest_info().
I would suggest that you extend ManifestBuilderTest to make a more complete test suite. You can then patch ManifestBuilder::get_manifest_info() with your performance improvements, safe in the knowledge that you haven't broken anything!
To run the manifest builder tests, visit (site)/TestRunner/only/ManifestBuilderTest
27 March 2008 at 9:35am
Hi everyone, quick status update. Ive got the load time down to a consistent 0.9 seconds, and am aiming to chop another .1 seconds off if i can. Im around halfway through writing the tests, hopefully will finish them this afternoon. I noticed one bug with the tests, which is now fixed. Attached is my local working version of the NewManifestBuilder.
|Go to Top|