Skip to end of metadata
Go to start of metadata

BUFR: Performance improvement by skipping some keys

Step-by-step guide

When we set the "unpack" key to decode the data section, for every Table B element key we create a set of attributes. So for example examine the output from "bufr_dump -jf" and you see meta-data attributes like:

"key" : "cloudCoverTotal",
"units" : "%",
"scale" : 0,
"reference" : 0,
"width" : 7

So in this case as well as having the key "cloudCoverTotal", you will also have "cloudCoverTotal->units" and "cloudCoverTotal->scale" etc.

In fact the cost of creating these extra keys is quite high so it would be advantageous for the users who do not care about these keys to omit them altogether.  This can be done (from ecCodes version 2.9.0) by setting the key:


Note: This must be done BEFORE calling unpack e.g.

codes_set(msgid, 'skipExtraKeyAttributes', 1)
codes_set(msgid, 'unpack', 1)

Now decoding will be on average 25% faster as fewer keys are created/destroyed. Note: This does not affect attributes like percentConfidence and associatedFieldSignificance. Their keys will be created if present in the message.

Setting this key will also speed up encoding: Set it to 1 before setting the "unexpandedDescriptors".