Overview of multithreading optimizations in Ladybug library.

Last Revision Date: 5/20/2014

This article discusses the addition of multithreading to the Ladybug library and its interaction with dual- and quad-core CPUs. 

With the release of Ladybug SDK v1.2.1.23, the Ladybug library takes advantage of multi-core CPUs during JPEG image capture. As dual-core and quad-core CPUs become more common, implementing multithreading enables users of the Ladybug2 to maximize their performance of their CPUs. This is made possible by efficiently distributing the raw JPEG images to all available CPUs, thus allowing multiple images to be decompressed in parallel. The amount of improvement seen depends on the quality of JPEG compression, as well as the colour processing algorithm used. In tests conducted in-house, improvements of up to 83% have been observed.

How To Use

Multithreading is available in Ladybug SDK v1.2.1.25 or higher. If a multi-core CPU is present, the library will automatically utilize multithreading during execution. If this is not desired, or you wish to restrict the library to a certain CPU, use the “Set Affinity” function in Task Manager. Complete instructions can be found on the Microsoft website.

Test Setup

    • Dell Precision 390
    • Intel Core 2 Duo E6300 (1.86GHz)
    • 2GB RAM
    • nVidia Quadro FX550 128MB

A single CPU setup was simulated on the test machine by disabling one of the CPU cores using the “Set Affinity” method described above.

Results

95% JPEG Compression

  Single Core CPU (Hz) Dual Core CPU (Hz) % improvement
Quarter Downsample 18.5 29.4 58.9%
Nearest Neighbor Fast 9.8 16.9 72.4%
Nearest Neighbor 9.0 15.7 74.4%
Edge Sensing 7.1 13.0 83.1%
Mono (Single channel) 29.4 29.4 0.0%

 

85% JPEG Compression

  Single Core CPU (Hz) Dual Core CPU (Hz) % improvement
Quarter Downsample 23.0 29.4 27.8%
Nearest Neighbor Fast 11.5 19.1 66.1%
Nearest Neighbor 10.2 17.3 69.6%
Edge Sensing 8.0 14.3 78.8%
Mono (Single channel) 29.4 29.4 0.0%