# US 2021/0279044 A1 · Performance optimization of class instance comparisons

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2021/0279044 A1
- Document ID: US20210279044A1
- Status: Published application
- Kind: A1
- Application number: 16/813,293
- Filed: 2020-03-09
- Published: 2021-09-09
- Earliest claimed: 2020-03-09
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Oluwatobi Ajila; Andrew James Craik; Daniel Heidinga; Graham Alan Chapman
- Web page: https://patentgrep.com/patent/US20210279044A1

## CPC

- G06F 8/4443: {Inlining}
- G06F 8/437: {Type checking}
- G06F 8/4441: {Reducing the execution time required by the program code}
- G06Q 30/0284: {Time or distance, e.g. usage of parking meters or taximeters}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06Q: INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR

## Abstract

An embodiment includes executing a code interpretation engine such that the interpretation engine interprets a first portion of a source code that includes a first comparison between a first pair of operands. The embodiment also includes performing, in memory, a first bitwise comparison between a block A1 and a block B1 of the first portion of the source code. The embodiment also speeds up execution of the first portion of the source code responsive to the first bitwise comparison producing a negative result. The embodiment speeds up the first portion by omitting at least one of (i) a second bitwise comparison between a block A2 and a block B2, and (ii) a field-wise comparison between a block A3 and a block B3.

## Claims

### Claim 1

A computer implemented method comprising:
executing a code interpretation engine such that the interpretation engine interprets a first portion of a source code that includes a first comparison between a first pair of operands, the first pair of operands comprising respective first data-type regions and respective second data-type regions;
performing, in memory, a first bitwise comparison between a block A1 of data and a block B1 of data from the respective first data-type regions of the first pair of operands of the first portion of the source code; and
speeding up execution of the first portion of the source code responsive to the first bitwise comparison producing a negative result, the speeding up of the first portion comprising omitting comparison of the respective second data-type regions of the first pair of operands by omitting at least one of (i) a second bitwise comparison between a block A2 of data and a block B2 of data of the first portion of the source code, and (ii) a field-wise comparison between a block A3 of data and a block B3 of data of the first portion of the source code.

### Claim 2 (depends on 1)

The computer implemented method of claim 1, further comprising:
performing, in memory for a second portion of the source code that includes a second comparison between a second pair of operands, responsive to the first bitwise comparison producing a positive result from the first bitwise comparison between a block C1 of data and a block D1 of data from respective first data-type regions of the second pair of operands of the second portion, and a second bitwise comparison on a block C2 of data and a block D2 of data from respective second data-type regions of the second pair of operands of the second portion; and
speeding up execution of the second portion of the source code responsive to the second bitwise comparison producing a positive result, the speeding up of the second portion comprising omitting a field-wise comparison between a block C3 of data and a block D3 of data of the second portion.

### Claim 3 (depends on 2)

The computer implemented method of claim 2, further comprising:
performing, in memory for a third portion of the source code that includes a third comparison between a third pair of operands, responsive to the first bitwise comparison producing a positive result from the first bitwise comparison between a block E1 of data and a block F1 of data from respective first data-type regions of the third pair of operands of the third portion, and a second bitwise comparison on a block E2 of data and a block F2 of data from respective second data-type regions of the third pair of operands of the third portion;
performing, in memory for the third portion of the source code, responsive to the second bitwise comparison producing a positive result, a field-wise comparison between a block E3 of data and a block F3 of data from respective third data-type regions of the third pair of operands of the third portion; and
writing a value to memory representative of a comparison result of the comparison between the third pair of operands.

### Claim 4 (depends on 3)

The computer implemented method of claim 3, further comprising performing, in memory, a recursive comparison between a block E4 of data and a block F4 of data of the third portion of the source code, wherein the block E4 and the block F4 include a recursive data type.

### Claim 5 (depends on 4)

The computer implemented method of claim 4, wherein the comparison result of the third pair of operands is based at least in part on the first bitwise comparison between the block E1 and the block F1, the second bitwise comparison between the block E2 and the block F2, the field-wise comparison between block E3 and F3, and the recursive comparison between the block E4 and the block F4.

### Claim 6 (depends on 3)

The computer implemented method of claim 3, further comprising performing, in memory, a floating-point comparison between a block E4 of data and a block F4 of data of the third portion of the source code, wherein the block E4 and the block F4 include a floating-point data type.

### Claim 7 (depends on 6)

The computer implemented method of claim 6, wherein the comparison result of the third pair of operands is based at least in part on the first bitwise comparison between the block E1 and the block F1, the second bitwise comparison between the block E2 and the block F2, the field-wise comparison between block E3 and F3, and the floating point comparison between the block E4 and the block F4.

### Claim 8 (depends on 1)

The computer implemented method of claim 1, wherein the block A1 and the block B1 include a primitive data type.

### Claim 9 (depends on 4)

The computer implemented method of claim 4, wherein the block A2 and the block B2 include a reference that refers to an inline data type.

### Claim 10 (depends on 5)

The computer implemented method of claim 5, wherein the block A3 and the block B3 include a floating-point data type.

### Claim 11 (depends on 1)

The computer implemented method of claim 1, wherein the first pair of operands include respective headers, and wherein the block A1 and the block B1 are at a first offset from the headers, and wherein the block A2 and the block B2 are at a second offset from the headers, wherein the second offset is greater than the first offset.

### Claim 12 (depends on 11)

The computer implemented method of claim 11, wherein the block A3 and the block B3 are at third offsets from the headers, the third offset being greater than the second offset.

### Claim 13

A computer usable program product for performing class instance comparisons, the computer program product comprising a computer readable storage medium having program instructions embodied therewith, the program instructions executable by a processor to cause the processor to perform operations comprising:
executing a code interpretation engine such that the interpretation engine interprets a first portion of a source code that includes a first comparison between a first pair of operands, the first pair of operands comprising respective first data-type regions and respective second data-type regions;
performing, in memory, a first bitwise comparison between a block A1 of data and a block B1 of data from the respective first data-type regions of the first pair of operands of the first portion of the source code; and
speeding up execution of the first portion of the source code responsive to the first bitwise comparison producing a negative result, the speeding up of the first portion comprising omitting comparison of the respective second data-type regions of the first pair of operands by omitting at least one of (i) a second bitwise comparison between a block A2 of data and a block B2 of data of the first portion of the source code, and (ii) a field-wise comparison between a block A3 of data and a block B3 of data of the first portion of the source code.

### Claim 14 (depends on 13)

The computer usable program product of claim 13, wherein the stored program instructions are stored in a computer readable storage device in a data processing system, and wherein the stored program instructions are transferred over a network from a remote data processing system.

### Claim 15 (depends on 13)

The computer usable program product of claim 13, wherein the stored program instructions are stored in a computer readable storage device in a server data processing system, and wherein the stored program instructions are downloaded over a network to a remote data processing system for use in a computer readable storage device associated with the remote data processing system, further comprising:
program instructions to meter use of the computer usable code associated with a request; and
program instructions to generate an invoice based on the metered use.

### Claim 16 (depends on 13)

A computer usable program product of claim 13, further comprising:
performing, in memory for a second portion of the source code that includes a second comparison between a second pair of operands, responsive to the first bitwise comparison producing a positive result from the first bitwise comparison between a block C1 of data and a block D1 of data from respective first data-type regions of the second pair of operands of the second portion, and a second bitwise comparison on a block C2 of data and a block D2 of data from respective second data-type regions of the second pair of operands of the second portion; and
speeding up execution of the second portion of the source code responsive to the second bitwise comparison producing a positive result, the speeding up of the second portion comprising omitting a field-wise comparison between a block C3 of data and a block D3 of data of the second portion.

### Claim 17 (depends on 16)

A computer usable program product of claim 16, further comprising:
performing, in memory for a third portion of the source code that includes a third comparison between a third pair of operands, responsive to the first bitwise comparison producing a positive result from the first bitwise comparison between a block E1 of data and a block F1 of data from respective first data-type regions of the third pair of operands of the third portion, and a second bitwise comparison on a block E2 of data and a block F2 of data from respective second data-type regions of the third pair of operands of the third portion;
performing, in memory for the third portion of the source code, responsive to the second bitwise comparison producing a positive result, a field-wise comparison between a block E3 of data and a block F3 of data from respective third data-type regions of the third pair of operands of the third portion; and
writing a value to memory representative of a comparison result of the comparison between the third pair of operands.

### Claim 18

A computer system comprising a processor and one or more computer readable storage media, and program instructions collectively stored on the one or more computer readable storage media, the program instructions executable by the processor to cause the processor to perform operations comprising:
executing a code interpretation engine such that the interpretation engine interprets a first portion of a source code that includes a first comparison between a first pair of operands, the first pair of operands comprising respective first data-type regions and respective second data-type regions;
performing, in memory, a first bitwise comparison between a block A1 of data and a block B1 of data from the respective first data-type regions of the first pair of operands of the first portion of the source code; and
speeding up execution of the first portion of the source code responsive to the first bitwise comparison producing a negative result, the speeding up of the first portion comprising omitting comparison of the respective second data-type regions of the first pair of operands by omitting at least one of (i) a second bitwise comparison between a block A2 of data and a block B2 of data of the first portion of the source code, and (ii) a field-wise comparison between a block A3 of data and a block B3 of data of the first portion of the source code.

### Claim 19 (depends on 18)

The computer system of claim 18, further comprising:
performing, in memory for a second portion of the source code that includes a second comparison between a second pair of operands, responsive to the first bitwise comparison producing a positive result from the first bitwise comparison between a block C1 of data and a block D1 of data from respective first data-type regions of the second pair of operands of the second portion, and a second bitwise comparison on a block C2 of data and a block D2 of data from respective second data-type regions of the second pair of operands of the second portion; and
speeding up execution of the second portion of the source code responsive to the second bitwise comparison producing a positive result, the speeding up of the second portion comprising omitting a field-wise comparison between a block C3 of data and a block D3 of data of the second portion.

### Claim 20 (depends on 19)

The computer system of claim 19, further comprising:
performing, in memory for a third portion of the source code that includes a third comparison between a third pair of operands, responsive to the first bitwise comparison producing a positive result from the first bitwise comparison between a block E1 of data and a block F1 of data from respective first data-type regions of the third pair of operands of the third portion, and a second bitwise comparison on a block E2 of data and a block F2 of data from respective second data-type regions of the third pair of operands of the third portion;
performing, in memory for the third portion of the source code, responsive to the second bitwise comparison producing a positive result, a field-wise comparison between a block E3 of data and a block F3 of data from respective third data-type regions of the third pair of operands of the third portion; and
writing a value to memory representative of a comparison result of the comparison between the third pair of operands.
