Browse Prior Art Database

Dynamic Method Name Registration for Improved Search Speed

IP.com Disclosure Number: IPCOM000109730D
Original Publication Date: 1992-Sep-01
Included in the Prior Art Database: 2005-Mar-24
Document File: 3 page(s) / 87K

Publishing Venue

IBM

Related People

Conner, MH: AUTHOR [+3]

Abstract

An improvement to object technology is disclosed. A software technique is presented that allows symbol name constants to be statically initialized and then converted dynamically to registered name tokens that are more efficient to manipulate.

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

Dynamic Method Name Registration for Improved Search Speed

       An improvement to object technology is disclosed.  A
software technique is presented that allows symbol name constants to
be statically initialized and then converted dynamically to
registered name tokens that are more efficient to manipulate.

      Object-oriented programming environments frequently need to
look up method names as part of the method resolution process (1).
This is one of their most frequent operations and, therefore, must be
highly optimized.  One of the standard components of this
optimization is name registration.  Name registration consists of
looking up the actual string form of a name in a registration table
and returning a unique token (usually a 4-byte integer) that can be
used for comparison or hashing much more efficiently than the
original string could be.  This technique can be awkward to apply in
the context of traditional programming languages such as ANSI C (2)
or C++ (3).  One would like a mechanism that would be convenient for
programmers to work with and still be efficient.  In particular, one
would like a mechanism in which static initialization could be used
for the string name of methods and where programmers need not be
aware of the process of name registration.

      The invention presented here consists of a programming
mechanism for method name registration that is both convenient and
efficient.  This technique has been implemented (4).  It consists of
defining a special data structure that can be initialized with the
string name of a method in the static initialization section of a C
or C++ program and then converted on first use to a unique token form
(via a registration process).  The use of the static initialization
is both efficient and allows the initialization code to be placed in
header files and thus largely removed from the programmer's view.

      The ANSI C declaration for the special data structure is given
below:
       char **somId;
Ids are initialized with statements like these:
       char *m_name = "m";
       somId m_id = &m_name;
A programmer uses an id in a manner like:
       entry = _somFindMethod(obj, m_id);
It is not necessary for th...