How can I improve the runtime performance of the OSS ASN.1 Tools for C++?

Guidelines for Improving the Runtime Performance of the OSS ASN.1 Tools for C++

  1. Use the TOED (Time-Optimized Encoder/Decoder) runtime instead of the SOED.
  2. Do not set the DEBUGPDU flag before calling the encoder/decoder. This will disable time-consuming tracing activity during encoding/decoding operations.
  3. Specify the ASN.1 compiler command line option -minimize when compiling your ASN.1 syntax. This will probably lead to a smaller .cpp file and will result in only crucial constraint checking being done on values which are being encoded/decoded. Alternatively, specify the NOCONSTRAIN flag before calling the encoder/decoder, thereby disabling runtime constraint checking while retaining the ability to later enable it if the need arises.
  4. Do not specify the OSS_TRAPPING flag before calling the encoder/decoder. This flag enables the trapping of memory violations and the construction of an error message that details which field of the PDU was being processed when the memory violation occurred. If your application is fully tested, you have every reason to not specify OSS_TRAPPING. For versions prior to 4.1, specify the NOTRAPPING flag before calling the encoder/decoder.
  5. Use OSS ASN.1/C++ Memory Pools API that provides optimized dynamic memory management. Please find the details in the section entitled "2.8.1.2 Memory pools" in the OSS ASN.1/C++ Runtime API Reference Manual (September 2010 Edition). The sample that demonstrates The Memory Pools API can be found in the samples/advanced/memory_pool subdirectory of the shipment.
  6. If you use the OSS TOED library, please review the section entitled "4.3 List of macros affecting the compilation of TOED code files" in the OSS ASN.1/C++ Runtime API Reference Manual (September 2010 Edition), and tune your application to achieve better performance by setting some of the listed macros.
  7. Use ownership-transferring functions to avoid excessive copying of large memory blocks. Use the OSS.POINTER directive to additionally generate ownership-transferring functions for components of constructed types. Please review the section entitled "3.7.17 OSS.POINTER / OSS.NOPOINTER" in the OSS ASN.1 Compiler for C++ Reference Manual (September 2010 Edition) for details.
  8. C++ compile the generated code with optimization flags.

Note: if runtime performance is very important for your application, you should consider using the OSS ASN.1 Tools for C, which are optimized for high speed and small memory footprint.


The samples included with some of the Knowledge Center answers are meant for your general understanding of the OSS products. Different versions of the products might produce slightly different outputs. Consult the products documentation and samples for the most up-to-date products information and code examples.



Contact Support
contact Our office hours
24 hours/day, 7 days/week

  • Phone: 1-888-OSS-2761 (USA and Canada)
  • Phone: 1-732-302-9669 (International)
  • Fax: 1-732-302-0023
  • Email: support@oss.com
Free Trial
download

Test drive the OSS Nokalva ASN.1, 4G and XML Tools now! Your trial includes complete software, documentation, sample programs, free 24x7 technical support and more.




Learn ASN.1
Learn ASN.1

Our expert personnel can help you learn ASN.1!

We offer 4-day ASN.1 courses at our headquarters or your premises.