Intel 170 Servers, AS/400 RISC Server, 7xx Servers manual Order1 Orderj Ordert OrderN, Brief Example

Models: 7xx Servers 170 Servers AS/400 RISC Server

1 368
Download 368 pages 6.76 Kb
Page 318
Image 318

Order(1)

Order(j)

Order(t)

Order(N)

ILE and OS/400

Just In Time compiled

Java threads

Data Base Records and

Programs

programs (Java *JIT)

 

IFS file records

Subsystem Descriptions

Total Job Storage

File Buffers of all kinds

Java (and C/C++)

 

 

 

objects

Direct Execution Java

Static storage from

SQL Result Set

Operating System

Programs

RPG and COBOL.

(nonrecord)

copies (e.g. Data Base)

 

Static final in Java.

 

copies of application

 

 

 

records

System values

Java Virtual Machine

Program stack storage

SQL records in a result

 

and most WebSphere

 

set

 

storage

 

 

A Brief Example

To show these concepts, consider a simple example.

Part of a financial system has three logical elements to deal with:

1.An order record (order summary including customer information, sales tax, etc.)

2.An order detail record (individual purchased items, quantities, prices).

3.A table containing international currency rates of exchange between two arbitrary countries.

Question: What is more important? Reducing the cost of the detail record by a couple of bytes, or reducing the currency table from a cost of N squared (where “N” is the number of countries) to 2 times N.

There are two obvious implementations of the currency table:

1.Implement the table as a two dimensional array such that CurrencyExchangei,j will give the exchange between countryi and countryj for all countries.

2.Implement the table as a single dimension array with the ith element being the exchange rate between countryi and the US dollar. One can convert to any country simply by converting twice; once to dollars and once to the other currency.

Clearly, the second is more storage efficient.

Now consider the first problem. The detail record looks like this:

Quantity as a four byte number (9B or 10B in RPG terms). Name of the item (up to 60 characters)

Price of the item (as a zoned decimal field, 15 total digits with two decimal points).

A simple scrub would give:

Quantity as a two byte number (4B in RPG terms). Name of the item (probably still 60 characters)

Price of the item (as a packed decimal field, probably 10 total digits with two decimal points).

IBM i 6.1 Performance Capabilities Reference - January/April/October 2008

 

© Copyright IBM Corp. 2008

Chapter 20 - General Tips and Techniques

318

Page 318
Image 318
Intel 170 Servers, AS/400 RISC Server, 7xx Servers manual Order1 Orderj Ordert OrderN, Brief Example