Skip to content

C Backend optimizations

Compare
Choose a tag to compare
@maxime-esa maxime-esa released this 22 Apr 07:13
· 156 commits to master since this release
e1f6ca1

This release introduces a new mode in asn1scc that optimizes the generated C code for ASN.1 Enumerated types, especially when there are multiple enumerants in the type (e.g., 50 or more).

When the -eee option is present, asn1scc generates more efficient and less verbose code. Instead of generating switch statements, asn1scc generates sorted arrays containing the possible values. Lookups, such as for validation or index retrieval in uPER encoding, are performed using an optimized binary search.

This results in more efficient code generation for large Enumerated types, improving performance and readability.

To use this mode, pass the minimum number of enumerants in an enumerated type to enable this mode as an argument to the -eee option. For example, -eee 50 will enable this mode for enumerated types with 50 or more enumerants.

In addition this release includes major improvements to the Scala backend (with Stainless proof/contracts).