class BenchmarkDeleteTruncate extends Benchmarker {
public function __construct() {
parent::__construct();
- $this->mDescription = "Benchmarks SQL DELETE vs SQL TRUNCATE.";
+ $this->addDescription( 'Benchmarks SQL DELETE vs SQL TRUNCATE.' );
}
public function execute() {
- $dbw = wfGetDB( DB_MASTER );
+ $dbw = $this->getDB( DB_MASTER );
$test = $dbw->tableName( 'test' );
$dbw->query( "CREATE TABLE IF NOT EXISTS /*_*/$test (
*/
private function insertData( $dbw ) {
$range = range( 0, 1024 );
- $data = array();
+ $data = [];
foreach ( $range as $r ) {
- $data[] = array( 'text' => $r );
+ $data[] = [ 'text' => $r ];
}
$dbw->insert( 'test', $data, __METHOD__ );
}