Data processing: software development – installation – and managem – Software program development tool – Programming language
Reexamination Certificate
1999-07-01
2003-02-18
Chaki, Kakali (Department: 2124)
Data processing: software development, installation, and managem
Software program development tool
Programming language
C717S118000, C717S148000, C717S151000
Reexamination Certificate
active
06523168
ABSTRACT:
FIELD OF THE INVENTION
The invention is generally related to computers and computer software. More specifically, the invention is generally related to compilation and interpretation of string concatenations and other operations that utilize temporary data storage.
BACKGROUND OF THE INVENTION
Managing memory is critically important to the performance and reliability of a data processing system such as a computer. Specifically, data used by a computer program is typically stored in a computer within a memory that has a limited address space. In many computers, data is stored in the form of “objects” that are allocated space in a portion of the memory referred to as an “object heap”.
In many computer environments, objects are created, or “allocated”, dynamically (i.e., on an as-needed basis) during the execution of a computer program. In addition, given that the amount of memory available in a computer is limited, some mechanism for removing, or “deallocating”, unused objects is also provided, typically either through the use of specific program instructions or through an automated process known as garbage collection. One well known computer programming environment that utilizes dynamic memory allocation, for example, is the Java programming environment developed by Sun Microsystems.
One primary benefit of dynamic memory allocation is that the overall amount of memory required to run a computer program is typically reduced, often reducing the memory requirements of a computer upon which the program is executed, or permitting more computer programs to share a given memory space in the computer. Computer performance may also benefit due to the reduced memory requirements, since less swapping of data into and out of memory may be required. Another benefit is that overall reliability of the computer is often improved since memory usage is typically better managed.
The primary drawback to dynamic memory management, however, is the additional “overhead” that is associated with both allocating and deallocating objects. Allocating and deallocating an object each require the computer to perform certain operations that are outside of the actual productive operations that are being performed during execution of a computer program. These additional operations delay the performance of the productive operations, which typically slows the overall operation of the computer. Therefore, for performance concerns, it is highly desirable to minimize whenever possible the number of object allocation and deallocation operations performed by a computer program.
The overhead associated with object allocation and deallocation is of particular concern with respect to computer operations that rely on “temporary” data storage. In particular, with objects that are used repeatedly over a significant period of time, the overhead associated with allocating and deallocating those objects becomes relatively insignificant compared to the productive operations that are performed with those objects. In contrast, whenever objects are only used for a brief period of time, the overhead associated with allocating and then deallocating the objects becomes more significant relative to the productive operations performed with those objects. Furthermore, although the overhead associated with each allocation and deallocation may be relatively minor, when the effects of a large number of operations that rely on temporary objects are considered, the collective impact on overall computer performance can be substantial.
A skilled computer programmer can in some instances reduce the number of object allocation and deallocation operations in a computer program during development of the computer program. In other instances, however, the programmer may not be able to control when some objects are allocated and/or deallocated. For example, a programmer writing a computer program in a source code, or human-readable format, may need to use certain instructions that, when translated into a machine-readable or intermediate format, inherently result in the creation of temporary objects due to the design of the particular translation program (e.g., a compiler or interpreter) used to translate the computer program to the machine-readable or intermediate format.
One such example is a string concatenation operation in the Java programming environment. A string concatenation operation, which is designated by the “+” operator in Java, creates a new string from the two objects identified as arguments to the operation. For example, the concatenation of a first string such as “start” with a second string such as “
1
e” would result in the creation of a new string “startle”.
Compilation of a string concatenation statement in a Java source code program by a Java compiler results in the generation of program code that utilizes a temporary mutable string object, known in Java as a “StringBuffer” object, in performing the string concatenation operation. As an example, Table I below illustrates an exemplary “myExample” Java class that includes an “exampleConcat” procedure that receives two arguments “s
1
” and “s
2
” and returns a “result” object that is the concatenation of the data in the “s
1
” and “s
2
” arguments:
TABLE I
Example String Concatenation
public class myExample {
public String exampleConcat(String s1, String s2) {
String result = s1 + s2;
return (result);
}
}
Compilation of the statement “String result=s
1
+s
2
” using a conventional Java compiler results in the generation of program code that generally corresponds to the statement shown in Table II below:
TABLE II
Conventional String Concatenation Compilation
String result = new StringBuffer(String.valueOf(s1)).append(s2).toString();
The above statement can be parsed into the following operations:
1. String.valueOf(s
1
)—returns a string representation of “s
1
”
2. new StringBuffer( . . . )—creates a new “StringBuffer” object containing the string representation of “s
1
”
3. .append(s
2
)—appends “s
2
” to the “StringBuffer” object
4. .toString( )—creates a new “String” object from the “StringBuffer” object
Operation 2 above results in the allocation of two objects: a StringBuffer object and an underlying character array object used by the StringBuffer object. Operation 4 above creates one additional object: a String object that is returned as the result of the operation. Operations 1 and 3 typically do not result in the creation of any objects, although in some circumstances additional objects may need to be created handle format conversion, for example if either s
1
or s
2
was in a format other than a string (e.g., an integer, a boolean value, etc.), or when the existing character array is not large enough to hold all of the characters in s
1
and s
2
. Therefore, a minimum of three objects are created for each string concatenation operation. Of these three objects, the StringBuffer object and its underlying character array object are not used after completion of the string concatenation operation. In most circumstances, both such objects are eventually deallocated by the Java garbage collector some time after completion of the string concatenation operation.
String concatenation operations are used extensively in a number of Java applications such as manipulating results from database files, and generating dynamic documents (e.g., hypertext markup language (HTML) documents and the like), among others. As such, it is possible in many applications for string concatenations to result in the creation of a relatively large number of temporary objects, which can have a significant negative impact on overall system performance.
Therefore, a substantial need exists in the art for a manner of improving the performance of a computer in performing operations that rely on temporary data storage, and in particular, for a manner of improving the performance of a computer in performing string concatenations and other like operations.
SUMMARY OF THE INVENTION
The invention addresses these and other problems associated with the prior art by
Arnold Jeremy Alan
Barsness Eric Lawrence
Santosuosso John Matthew
Chaki Kakali
Ingberg Todd
Wood Herron & Evans LLP
LandOfFree
Reduction of object creation during string concatenation and... does not yet have a rating. At this time, there are no reviews or comments for this patent.
If you have personal experience with Reduction of object creation during string concatenation and..., we encourage you to share that experience with our LandOfFree.com community. Your opinion is very important and Reduction of object creation during string concatenation and... will most certainly appreciate the feedback.
Profile ID: LFUS-PAI-O-3154870