Plain – Parsing VM Instructions

One concern as I implement the VM is the parsing performance on instructions. The Data Descriptor below illustrate the challenge. It is a dynamic structure with bit fields. For every bit field I end up decoding it causing AND /ROTATE instructions.

It is bit packed to save space, but decoding a bit-packed field will cost performance. To increase performance I could use more space – I can’t win, so this will be a horse trade.

For now I will ignore the challenge and be prepared to optimize this later. Plain is not designed for high speed, it is designed for high level logic, so I think it will be ok. I will do a performance test later.

The fastest “bit” packing is a XML string if you ignore space. This will surprice many, but a well build XMP parser is far faster than a bit decoder.

Leave a Reply