for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use PHPinnacle\Buffer\ByteBuffer;
/**
* @BeforeMethods({"init"})
* @AfterMethods({"clear"})
*/
class BufferWriteBench
{
* @var ByteBuffer
private $buffer;
* @return void
public function init(): void
$this->buffer = new ByteBuffer();
}
* @Revs(5)
* @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(str_repeat('str', 1000))
public function clear(): void
$this->buffer->flush();