Chunk: be more intelligent about fast-serializing chunks

This reduces the amount of useless data that pthreads has to copy around.
This commit is contained in:
Dylan K. Taylor
2018-11-03 14:05:36 +00:00
parent 6b9fee05d6
commit a50a863ab7
4 changed files with 49 additions and 47 deletions

View File

@ -222,23 +222,6 @@ class SubChunk implements SubChunkInterface{
return "\x00" . $this->ids . $this->data;
}
public function fastSerialize() : string{
return
$this->ids .
$this->data .
$this->skyLight .
$this->blockLight;
}
public static function fastDeserialize(string $data) : SubChunk{
return new SubChunk(
substr($data, 0, 4096), //ids
substr($data, 4096, 2048), //data
substr($data, 6144, 2048), //sky light
substr($data, 8192, 2048) //block light
);
}
public function __debugInfo(){
return [];
}