Browse Prior Art Database

Performance Enhancement for String Comparison

IP.com Disclosure Number: IPCOM000121858D
Original Publication Date: 1991-Oct-01
Included in the Prior Art Database: 2005-Apr-03
Document File: 2 page(s) / 49K

Publishing Venue

IBM

Related People

Cross, MR: AUTHOR [+2]

Abstract

Disclosed is a technique which performs a one-time analysis of a collating sequence and sets a flag which indicates the proper assumptions to be made during comparison.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 65% of the total text.

Performance Enhancement for String Comparison

      Disclosed is a technique which performs a one-time
analysis of a collating sequence and sets a flag which indicates the
proper assumptions to be made during comparison.

      A collating sequence is a set of weights associated with each
character in the code page of the database.  When characters are
compared, the values of these weights determine the result of the
comparison.  For example, if the character 'A' has a weight of 65,
and the character 'a' has a weight of 97, 'a' > 'A'.  On the other
hand, if the character 'A' has a weight of 193, and the character 'a'
has a weight of 129, 'a' < 'A'.

      Weights need not be unique.  If two characters have the same
weight, they are considered equal.

      The OS/2* operating system typically provides a set of
non-unique weights.  For example, lowercase and uppercase versions of
the same character usually have the same weight. To force strings
that differ only by case to always sort in the same order, &dm.
performs a two- pass string comparison. First, the strings are
compared according to the operating system weights. Then, if the
strings are equal, they are compared again using the underlying
numeric value of each character (that is, the number which is used
internally to represent the character in the current code page).
Using such a procedure, 'A' < 'a', but 'AC' > 'ab'.

      To improve performance, the following technique is employed.

    ...