Native C++23 PHP extension porting pocketmine\nbt plus NetworkNbtSerializer. NBT is
Minecraft's binary tree format. Drop-in replacement for the composer package.
What it's for: world save/load (LevelDB, LittleEndian), Java-world import (BigEndian), and the network encoding of chunks and block entities — chests, signs, etc. (Network varints). Every chunk sent or saved goes through this, so it's a major throughput path.
2000 iterations, real Bedrock level.dat (589 B) + chest-like block entity (1791 B network):
| Operation | Pure PHP | ext-nbt | Speedup |
|---|---|---|---|
| LE read (level.dat) | 41.65 µs | 3.13 µs | 13.3× |
| LE write (level.dat) | 16.62 µs | 0.91 µs | 18.3× |
| NET read (block entity) | 228.91 µs | 17.44 µs | 13.1× |
| NET write (block entity) | 103.37 µs | 5.38 µs | 19.2× |
| clone deep tree | 4.35 µs | 0.96 µs | 4.5× |
| equals deep tree | 4.76 µs | 0.47 µs | 10.1× |