File: benchmark-apcu.php

package info (click to toggle)
phpmyadmin-motranslator 5.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,912 kB
  • sloc: php: 1,758; makefile: 9
file content (29 lines) | stat: -rw-r--r-- 640 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php

declare(strict_types=1);

require './vendor/autoload.php';

$files = [
    'big' => './tests/data/big.mo',
    'little' => './tests/data/little.mo',
];

$start = microtime(true);

for ($i = 0; $i < 2000; ++$i) {
    foreach ($files as $domain => $filename) {
        $translator = new PhpMyAdmin\MoTranslator\Translator(
            new PhpMyAdmin\MoTranslator\Cache\ApcuCache(
                new PhpMyAdmin\MoTranslator\MoParser($filename), 'foo', $domain
            )
        );
        $translator->gettext('Column');
    }
}

$end = microtime(true);

$diff = $end - $start;

echo 'Execution took ' . $diff . ' seconds' . "\n";