17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1350 Views |
-
ManifestBuilder Rewrite

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
require_once("core/ManifestBuilder.php");
withrequire_once("core/NewManifestBuilder.php");
and replace the lines
if(ManifestBuilder::staleManifest()){
ManifestBuilder::compileManifest();
}with
NewManifestBuilder::run();
-
Re: ManifestBuilder Rewrite

26 March 2008 at 8:03pm Last edited: 26 March 2008 9:59pm
(I forgot to click the upload button)
-
Re: ManifestBuilder Rewrite

26 March 2008 at 10:28pm
Hi Grayzag,
To help get you started with the tests, I've committed a change to trunk
http://open.silverstripe.com/changeset/51689* 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
-
Re: ManifestBuilder Rewrite

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.
| 1350 Views | ||
|
Page:
1
|
Go to Top |

