aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/stephenhill/base58/benchmarks
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/stephenhill/base58/benchmarks')
-rw-r--r--vendor/stephenhill/base58/benchmarks/Base16Event.php24
-rw-r--r--vendor/stephenhill/base58/benchmarks/Base58BCMathEvent.php33
-rw-r--r--vendor/stephenhill/base58/benchmarks/Base58GMPEvent.php33
-rw-r--r--vendor/stephenhill/base58/benchmarks/Base64Event.php24
4 files changed, 114 insertions, 0 deletions
diff --git a/vendor/stephenhill/base58/benchmarks/Base16Event.php b/vendor/stephenhill/base58/benchmarks/Base16Event.php
new file mode 100644
index 000000000..f3ec0034d
--- /dev/null
+++ b/vendor/stephenhill/base58/benchmarks/Base16Event.php
@@ -0,0 +1,24 @@
+<?php
+
+namespace StephenHill\Benchmarks;
+
+use Athletic\AthleticEvent;
+
+class Base16Event extends AthleticEvent
+{
+ /**
+ * @iterations 10000
+ */
+ public function encodeBase16()
+ {
+ bin2hex('Hello World');
+ }
+
+ /**
+ * @iterations 10000
+ */
+ public function decodeBase16()
+ {
+ pack('H*', '48656c6c6f20576f726c64');
+ }
+}
diff --git a/vendor/stephenhill/base58/benchmarks/Base58BCMathEvent.php b/vendor/stephenhill/base58/benchmarks/Base58BCMathEvent.php
new file mode 100644
index 000000000..fc8ec23ee
--- /dev/null
+++ b/vendor/stephenhill/base58/benchmarks/Base58BCMathEvent.php
@@ -0,0 +1,33 @@
+<?php
+
+namespace StephenHill\Benchmarks;
+
+use Athletic\AthleticEvent;
+use StephenHill\Base58;
+use StephenHill\BCMathService;
+
+class Base58BCMathEvent extends AthleticEvent
+{
+ protected $base58;
+
+ public function setUp()
+ {
+ $this->base58 = new Base58(null, new BCMathService());
+ }
+
+ /**
+ * @iterations 10000
+ */
+ public function encodeBase58()
+ {
+ $this->base58->encode('Hello World');
+ }
+
+ /**
+ * @iterations 10000
+ */
+ public function decodeBase58()
+ {
+ $this->base58->decode('JxF12TrwUP45BMd');
+ }
+}
diff --git a/vendor/stephenhill/base58/benchmarks/Base58GMPEvent.php b/vendor/stephenhill/base58/benchmarks/Base58GMPEvent.php
new file mode 100644
index 000000000..d8a4d20bf
--- /dev/null
+++ b/vendor/stephenhill/base58/benchmarks/Base58GMPEvent.php
@@ -0,0 +1,33 @@
+<?php
+
+namespace StephenHill\Benchmarks;
+
+use Athletic\AthleticEvent;
+use StephenHill\Base58;
+use StephenHill\GMPService;
+
+class Base58GMPEvent extends AthleticEvent
+{
+ protected $base58;
+
+ public function setUp()
+ {
+ $this->base58 = new Base58(null, new GMPService());
+ }
+
+ /**
+ * @iterations 10000
+ */
+ public function encodeBase58()
+ {
+ $this->base58->encode('Hello World');
+ }
+
+ /**
+ * @iterations 10000
+ */
+ public function decodeBase58()
+ {
+ $this->base58->decode('JxF12TrwUP45BMd');
+ }
+}
diff --git a/vendor/stephenhill/base58/benchmarks/Base64Event.php b/vendor/stephenhill/base58/benchmarks/Base64Event.php
new file mode 100644
index 000000000..a558968a3
--- /dev/null
+++ b/vendor/stephenhill/base58/benchmarks/Base64Event.php
@@ -0,0 +1,24 @@
+<?php
+
+namespace StephenHill\Benchmarks;
+
+use Athletic\AthleticEvent;
+
+class Base64Event extends AthleticEvent
+{
+ /**
+ * @iterations 10000
+ */
+ public function encodeBase64()
+ {
+ base64_encode('Hello World');
+ }
+
+ /**
+ * @iterations 10000
+ */
+ public function decodeBase64()
+ {
+ base64_decode('SGVsbG8gV29ybGQ=');
+ }
+}