NordicSemiconductor / zcbor

Low footprint C/C++ CBOR library and Python tool providing code generation from CDDL descriptions.
Apache License 2.0
118 stars 37 forks source link

zcbor.py: Add a cache for compiled regex patterns #330

Closed oyvindronningstad closed 1 year ago

oyvindronningstad commented 1 year ago

Instead of calling with the raw pattern every time, make a cache of compiled regexes that just returns the precompiled regex on subsequent calls.

This speeds up execution.