IntroductionThe tasman.bars package takes advantage of multi-processor systems in two ways:
The above two techniques are not mutually exclusive. Both may be used.
The task of reading an image for barcodes is shared among processors. The tasman.bars package has automatic support for this technique built in. Read times can be significantly shortened, especially for large images. (With smaller images the time overhead of organizing the separate threads can negate the time saving of the subsequent read.)
Each column of graphs to the right shows processor utilization while reading a large image for barcodes, using a different number of processors in each column. (1, 2, 4, and 8). The horizontal axes (left to right) represents time, and the vertical axes indicates the extent of processor utilisation at any instant (blue / bottom = 0%, orange / top=100%). The times to read the image for barcodes are indicated by the widths of the 'humps'.
Image: gray scale tif, 10,104 x 6,592 pixels. Reading for Code 128, Code 39, and Interleaved 2 of 5. Scanning in all four directions. CPU architecture: two four-core processors. Time to read image for barcodes (milliseconds): 1 processor: 3,440 2 processor: 1,960 4 processor: 1,366 8 processor: 861
Separate threads are used to read different images concurrently. This is readily
accomplished using the java.util.concurrent package. The
tasman.bars SDK includes
sample applications, with source code, demonstrating this technology.
Each column of graphs to the right shows processor utilization during a batch run reading a number of images of various sizes, using a different number of processors in each column. (1, 2, 4, and 8). The horizontal axes (left to right) represents time,and the vertical axes indicates the extent of processor utilisation at any instant (blue / bottom = 0%, orange / top=100%). The widths of the 'humps' indicate the times to read the images for barcodes.
77 Images: 21MB on disk, various sizes, types (bmp, gif, png, jpg, tif), and color depths.
Reading for Code 128, Code 39, and Interleaved 2 of 5.
Scanning in all four directions.
CPU architecture: two four-core processors.
Time to read all images for barcodes (milliseconds):
1 processor: 21,378
2 processor: 11,915
4 processor: 7,166
8 processor: 3,575
Multi-thread performance varies with architecture. Core distribution among processors, cache memory sizes, and cache sharing between cores, are some of several system design aspects that can significantly affect performance tests such as those reported herein.
The bardemo application may be used to investigate multi-thread performance. The settings button in its toolbar accesses a dialog which may be used to control independently the number of: 1. image threads; and 2. batch threads on a multi-processor system.