*/
class Bench_MDDoBaseURL extends Codebench {
public $description =
'Optimization for the doBaseURL()
method of Kohana_Kodoc_Markdown
for the Kohana Userguide.';
public $loops = 10000;
public $subjects = array
(
// Valid matches
'[filesystem](about.filesystem)',
'[filesystem](about.filesystem "Optional title")',
'[same page link](#id)',
'[object oriented](http://wikipedia.org/wiki/Object-Oriented_Programming)',
// Invalid matches
'',
'[filesystem](about.filesystem',
);
public function bench_original($subject)
{
// The original regex contained a bug, which is fixed here for benchmarking purposes.
// At the very start of the regex, (?!!) has been replace by (?