Skip to content

Instantly share code, notes, and snippets.

@tractorcow
tractorcow / gist:6969805
Created October 14, 2013 02:31
Performance using PDO
$ ./sake dev/benchmarks/all "flush=all"
SQLBENCHMARK
------------
SQLBENCHMARK
benchmarkSelect
---------------
@tractorcow
tractorcow / gist:6969731
Created October 14, 2013 02:21
Current performance
$ ./sake dev/benchmarks/all "flush=all"
SQLBENCHMARK
------------
SQLBENCHMARK
benchmarkSelect
---------------
@tractorcow
tractorcow / gist:6969730
Created October 14, 2013 02:20
Parameterised query performance
$ ./sake dev/benchmarks/all "flush=all"
SQLBENCHMARK
------------
SQLBENCHMARK
benchmarkSelect
---------------
public function testFirstSentence() {
$many = str_repeat('many ', 100);
$cases = array(
'<h1>should ignore</h1><p>First sentence. Second sentence.</p>' => 'First sentence.',
'<h1>should ignore</h1><p>First Mr. sentence. Second sentence.</p>' => 'First Mr. sentence.',
"<h1>should ignore</h1><p>Sentence with {$many}words. Second sentence.</p>"
=> "Sentence with {$many}words.",
'<p>This classic picture book features a repetitive format that lends itself to audience interaction.&nbsp; Illustrator Eric Carle submitted new, bolder artwork for the 25th anniversary edition.</p>'
=> 'This classic picture book features a repetitive format that lends itself to audience interaction.'
);