PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 2.4.6
Booking for Appointments and Events Calendar – Amelia v2.4.6
2.4.7 2.4.6 2.4.5 2.4.4 2.4.3 2.4.2 2.4.1 2.4 trunk 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.28 1.2.29 1.2.3 1.2.30 1.2.31 1.2.32 1.2.33 1.2.34 1.2.35 1.2.36 1.2.37 1.2.38 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.3
ameliabooking / vendor / sabre / vobject / bin / bench_manipulatevcard.php
ameliabooking / vendor / sabre / vobject / bin Last commit date
bench.php 7 months ago bench_freebusygenerator.php 7 months ago bench_manipulatevcard.php 7 months ago fetch_windows_zones.php 1 year ago generate_vcards 1 year ago generateicalendardata.php 7 months ago mergeduplicates.php 7 months ago rrulebench.php 7 months ago vobject 1 year ago
bench_manipulatevcard.php
50 lines
1 <?php
2
3 include __DIR__ . '/../vendor/autoload.php';
4 if ($argc < 2) {
5 echo 'sabre/vobject ', \AmeliaVendor\Sabre\VObject\Version::VERSION, " manipulation benchmark\n";
6 echo "\n";
7 echo "This script can be used to measure the speed of opening a large amount of\n";
8 echo "vcards, making a few alterations and serializing them again.\n";
9 echo 'system.';
10 echo "\n";
11 echo 'Usage: ' . $argv[0] . " inputfile.vcf\n";
12 exit;
13 }
14 list(, $inputFile) = $argv;
15 $input = file_get_contents($inputFile);
16 $splitter = new \AmeliaVendor\Sabre\VObject\Splitter\VCard($input);
17 $bench = new Hoa\Bench\Bench();
18 while (true) {
19 $bench->parse->start();
20 $vcard = $splitter->getNext();
21 $bench->parse->pause();
22 if (!$vcard) {
23 break;
24 }
25 $bench->manipulate->start();
26 $vcard->{'X-FOO'} = 'Random new value!';
27 $emails = [];
28 if (isset($vcard->EMAIL)) {
29 foreach ($vcard->EMAIL as $email) {
30 $emails[] = (string) $email;
31 }
32 }
33 $bench->manipulate->pause();
34 $bench->serialize->start();
35 $vcard2 = $vcard->serialize();
36 $bench->serialize->pause();
37 $vcard->destroy();
38 }
39 echo $bench, "\n";
40 function formatMemory($input)
41 {
42 if (strlen($input) > 6) {
43 return round($input / (1024 * 1024)) . 'M';
44 } elseif (strlen($input) > 3) {
45 return round($input / 1024) . 'K';
46 }
47 }
48 unset($input, $splitter);
49 echo 'peak memory usage: ' . formatMemory(memory_get_peak_usage()), "\n";
50 echo 'current memory usage: ' . formatMemory(memory_get_usage()), "\n";