Follows-up
847b91b.
Noticed that in Xenon profiles, about 25% of Database::__construct
time is spent in array_map, via DatabaseDomain::convertToString.
* Database::__construct
* DatabaseDomain::__construct/convertToString/array_map
* DatabaseDomain::newUnspecified
* DatabaseDomain::__construct/convertToString/array_map
* DatabaseMysqlBase::open
* mysqli::*
Change-Id: Ib5ae7d1d03b27df504a7e5f552e36a0ca6fcf97e
throw new InvalidArgumentException( "Prefix must be a string." );
}
$this->prefix = $prefix;
- $this->equivalentString = $this->convertToString();
}
/**
);
}
- return ( $this->equivalentString === $other );
+ return ( $this->getId() === $other );
}
/**
* @return string
*/
public function getId() {
+ if ( $this->equivalentString === null ) {
+ $this->equivalentString = $this->convertToString();
+ }
+
return $this->equivalentString;
}