addDescription( 'Benchmark for JavaScriptMinifier.' ); $this->addOption( 'file', 'Path to JavaScript file (may be gzipped)', false, true ); } public function execute() { $file = $this->getOption( 'file', __DIR__ . '/jsmin/jquery-3.2.1.js.gz' ); $filename = basename( $file ); $content = $this->loadFile( $file ); if ( $content === false ) { $this->fatalError( 'Unable to open input file' ); } $this->bench( [ "minify ($filename)" => [ 'function' => [ JavaScriptMinifier::class, 'minify' ], 'args' => [ $content ], ], ] ); } } $maintClass = BenchmarkJavaScriptMinifier::class; require_once RUN_MAINTENANCE_IF_MAIN;