13.10.2014 Views

OPTIMIZING THE JAVA VIRTUAL MACHINE INSTRUCTION SET BY ...

OPTIMIZING THE JAVA VIRTUAL MACHINE INSTRUCTION SET BY ...

OPTIMIZING THE JAVA VIRTUAL MACHINE INSTRUCTION SET BY ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

137<br />

because of the presence of the intervening transfers of control. Many optimizations<br />

are possible. They are discussed in Section 7.7. The codelet for a multicode that has<br />

been optimized in this manner will be expressed as:<br />

x 1 x 2 x 3 ...x n → (7.5)<br />

The difference in performance between the optimized multicode and the original<br />

sequence of bytecodes is expressed as:<br />

∆ x1 x 2 x 3 ...x n→ = Cost(x 1 → x 2 → x 3 → ... → x n →) − Cost(x 1 x 2 x 3 ...x n →) (7.6)<br />

Because the cost of a transfer of control is non-zero, the following relationship<br />

exists between a bytecode sequence, its equivalent unoptimized multicode and its<br />

equivalent optimized multicode:<br />

Cost(x 1 x 2 x 3 ...x n →) ≤ Cost(x 1 /x 2 /.../x n →) < Cost(x 1 → x 2 → ... → x n →)<br />

(7.7)<br />

The first relational operator is expressed as a less than or equal because there is no<br />

guarantee that additional optimization opportunities will be possible. Consequently,<br />

it is possible that the performance of x 1 x 2 x 3 ...x n → will be identical to x 1 / x 2 / x 3 / ...<br />

/ x n →. However, because a transfer of control has a non-zero cost, it is known that<br />

the cost of x 1 / x 2 / x 3 / ... / x n → will be strictly less than the cost of x 1 →x 2 →x 3 →...<br />

→x n → since n is known to be greater than 1 from the definition of a multicode. Based<br />

on the relationships in Equation 7.7 it is also known that the relationship between<br />

the changes in performance is:<br />

∆ x1 x 2 x 3 ...x n→ ≥ ∆ x1 /x 2 /x 3 /.../x n→ (7.8)<br />

The impact a multicode has on application performance is not solely related to<br />

the difference in performance between the the bytecode sequence and the multicode.<br />

The number of times that the bytecode sequence will be executed is also a critical<br />

factor, and will be denoted by:<br />

N x1 →x 2 →x 3 →...→x n→ (7.9)<br />

There may be occurrences of the bytecode sequence that are executed but are not

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!