for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use PHPinnacle\Buffer\ByteBuffer;
/**
* @BeforeMethods({"init"})
*/
class AppendBench
{
* @var ByteBuffer
private $buffer;
* @var string
private $string;
* @return void
public function init(): void
$this->buffer = new ByteBuffer;
$this->string = \str_repeat('str', 1000);
}
* @Revs(1000)
* @Iterations(100)
*
public function benchAppendIntegers(): void
$this->buffer
->appendInt8(1)
->appendInt16(1)
->appendInt32(1)
->appendInt64(1)
->appendUint8(1)
->appendUint16(1)
->appendUint32(1)
->appendUint64(1)
;
public function benchAppendFloats(): void
->appendFloat(1.0)
->appendFloat(-1.0)
->appendFloat(\M_PI)
->appendDouble(1.0)
->appendDouble(-1.0)
->appendDouble(\M_PI)
public function benchAppendString(): void
->append('some string')
->append("other string")
->append($this->string)