Performance Comparison from Delphi 2010 to Delphi XE6 (Part 7b – RSCL Primitives)

RSCL Primitives Application, FMX, Win32

In our last blog post, we compared SVG drawing performance for the different versions of Delphi using low-level canvas routines.  However, the RiverSoftAVG SVG Component Library (RSCL) also contains a TRSSVGPanel component, which is able to generate FMX shape controls (TLayout and TPath mostly) descendants from an SVG to allow GUI interaction.  It was our thought that this could be useful for performance testing FMX primitives speed as these primitives are what controls are made of in the FMX library.  The RSCL converts the SVG elements listed in the last post into the following primitives:

Listing of SVG Primitives created for each SVG

Listing of SVG Primitives created for each SVG

Note that the loading, parsing, and building of the RSCL SVG elements and primitives are not tested in these tables.  Rather, the speed that the FMX library performs in refreshing the display of all the primitives that make up the SVG representation.

Comparison of averaged execution speed for the FMX RSCL Primitives application (Win32) with the baseline GDI+ VCL application, for Delphi XE2 to XE6

Comparison of averaged execution speed for the FMX RSCL Primitives application (Win32) with the baseline GDI+ VCL application, for Delphi XE2 to XE6

Before starting, we again did a sanity test to compare the FMX version to the VCL version. The VCL version uses GDI+, which is a software graphics library, so the hardware-optimized FMX TCanvas operations should be significantly faster.  Thankfully, that is what we see.  Every Delphi version of the FMX application was 4x-5x faster on average than the VCL application (XE6).

Comparison of execution speed for the FMX RSCL Primitives application (Win32) with Delphi XE2 to XE6

Comparison of execution speed for the FMX RSCL Primitives application (Win32) with Delphi XE2 to XE6

Zooming in on the primitives drawing performance for each individual SVG, Delphi XE2 dominates, drawing 2 SVGs fastest outright, tieing in drawing the Clock, and only 2/3 ms behind the leader drawing the Car SVG.  Delphi XE3 does especially poorly in performance.  Delphi XE6 comes in 4th place trailing XE2 by approximately 14%.

Ratio of Drawing vs FMX Primitives execution speed for RSCL applications in Delphi XE2 to XE6 (Win32)

Ratio of Drawing vs FMX Primitives execution speed for RSCL applications in Delphi XE2 to XE6 (Win32)

Comparing performance when drawing directly to the canvas versus using primitives, we see a mix of results.  The Clock and the Car are faster when using primitives, and the Watch and the Flag are faster when using the canvas directly.  Without more extensive profiling, it is difficult to say exactly why this is so.  If you remember the SVG element breakdown from the last post, the Clock and the Car have significantly more gradients and gradients stops and a lot fewer paths than the Watch and the Flag.  Since the RSCL caches Brushes and Pens after the first drawing call, the RSCL primitives do not have an advantage from the greater number of gradients.  It is probable that the FMX library bogs down as the number of primitives goes up.

*Note that Delphi XE3 had visual artifacts drawing the Car and the Watch.  

RSCL Primitives Application, FMX, Win64

Moving to 64-bits, Delphi XE2 again wins and is the only version to actually improve its average score from 32-bits.  It renders the Watch and Flag fastest, ties for the Clock, and trails the leader by 1.66 ms for the Car.  Delphi XE3 continues its poor performance.  Delphi XE6 is approximately 16% slower than Delphi XE2.

Comparison of execution speed for the FMX RSCL Primitives application (Win64) with Delphi XE2 to XE6

Comparison of execution speed for the FMX RSCL Primitives application (Win64) with Delphi XE2 to XE6

Ratio of Win64 to Win32 execution speed for RSCL Primitives applications in Delphi XE2 to XE6 (FMX)

Ratio of Win64 to Win32 execution speed for RSCL Primitives applications in Delphi XE2 to XE6 (FMX)

*Note that Delphi XE3 had visual artifacts drawing the Car and the Watch. 

RSCL Primitives Application, FMX, OSX

When we start testing using the OSX platform, the performance of all versions of Delphi suffer dramatically.  Unlike drawing directly to the canvas, the FMX primitives on OSX are very slow… for Delphi XE3, it is even slower than the non-hardware accelerated GDI+ version!

Comparison of execution speed for the FMX RSCL Primitives application (OSX) with Delphi XE2 to XE6

Comparison of execution speed for the FMX RSCL Primitives application (OSX) with Delphi XE2 to XE6

Ratio of Win32 to OSX execution speed for RSCL Primitives applications in Delphi XE2 to XE6 (FMX)

Ratio of Win32 to OSX execution speed for RSCL Primitives applications in Delphi XE2 to XE6 (FMX)

 

Delphi XE2, XE3, and XE4 suffer the most coming to the OSX platform.  Delphi XE5 and XE6 make great showings in comparison.  Delphi XE5 is the fastest when using primitives by a large margin.  Delphi XE6 is in second place but about 18% slower than XE5.

*Note that Delphi XE3 had visual artifacts drawing the Car and the Watch. 

RSCL Primitives Application, FMX, iOS

Comparing Delphi XE4 through XE6 on mobile, Delphi XE5 maintains its performance advantage.  On iOS, Delphi XE5 is fastest using FMX primitives, with a 6%-7% speed advantage.  The Delphi XE6 numbers are very respectable.  With SVGs with more paths (Watch and Flag), Delphi XE6 manages to be faster than XE4.

Comparison of execution speed for the FMX RSCL Primitives application (iOS) with Delphi XE4 to XE6

Comparison of execution speed for the FMX RSCL Primitives application (iOS) with Delphi XE4 to XE6

*Delphi XE4 was last on iOS.  In addtion, there were minor visual artifacts (gradients) drawing the SVGs.

RSCL Primitives Application, FMX, Android

Our final test in this series of blog posts is on the Android platform.  Delphi XE5 wins the performance crown when using FMX primitives on Android, though it is a narrow victory.  Delphi XE6 loses by over 6% when drawing the Clock.  However, as the number of primitives go up, Delphi XE6 starts catching up and is less than 2% slower when drawing the most complex SVG (Watch).

Comparison of execution speed for the FMX RSCL Primitives application (Android) between Delphi XE5 and XE6

Comparison of execution speed for the FMX RSCL Primitives application (Android) between Delphi XE5 and XE6

Finally!  We are finished with our performance tests!  In the concluding blog post, I summarize the results and discuss how Delphi XE6 did.

Leave a Reply

Your email address will not be published. Required fields are marked *