INFORMIX
INFORMIX-GLS Programmer's Guide
Chapter 1: Using INFORMIX-GLS
Home Contents Index Master Index New Book

Improving Program Performance

Performance of an application that uses INFORMIX-GLS is enhanced in the following ways:

INFORMIX-GLS Optimization

The INFORMIX-GLS functions are optimized to perform the following tasks:

    1. Evaluate the requested INFORMIX-GLS function.

    2. Determine if the requested function is appropriate for the data you are trying to process.

    3. Execute the code that is appropriate for the type of data.

For example, if you use the ifx_gl_mbsnext() function to traverse data that is encoded in a single-byte code set, the function is reduced to a macro that advances the character byte by byte. The function does not execute code that parses multibyte sequences because it determines that the data is single byte.

Additionally, when collation is based on code-set order rather than localized order, functions use a binary compare (such as strcmp()) instead of algorithms that examine collation weights.

Wide-Character Processing

You can choose how to structure your data to improve performance. INFORMIX-GLS provides wide-character versions of most of its multibyte processing functions. Typically, wide-character processing functions are faster than multibyte-character functions. However, wide characters require more space. Therefore, character data is generally stored and retrieved from the database in its multibyte form.

If you choose to use wide-character processing, follow these steps:

    1. Convert the multibyte string into a wide-character string.

    You can use the ifx_gl_mbstowcs() function.

    2. Process the wide-character string.

    3. Convert the wide-character string back to a multibyte string.

    You can use the ifx_gl_wcstombs() function.

This technique is cost-effective if the data that you process is traversed more than once. For more information on wide characters, see "Wide Characters".




INFORMIX-GLS Programmer's Guide, version 9.1
Copyright © 1998, Informix Software, Inc. All rights reserved.