Performance

Updates to Maple 18 have greatly improved performance and efficiency in several key categories. Improvements in performance and efficiency include: 

Faster high precision computations

In Maple 18, we upgraded the version of GMP, the GNU Multiple Precision Arithmetic Library, used for the Maple engine to 5.1.1.  This greatly improves performance for new CPUs, as well as improves optimizations for existing platforms, especially 64-bit platforms. 

> kernelopts(gmpversion); 1
 
5.1.1
 

The following figure shows the difference in performance between Maple 17 and Maple 18 for basic operations that utilize the GMP. This operated on a Intel64-bit i7 processor. 

Plot_2d
 

Integration of LLVM

Maple 18 has incorporated the LLVM compiler infrastructure to provide an out-of-the-box solution for the native code compilation feature of the Compiler:-Compiler command. The addition of LLVM offers many advantages over previous releases. 

LLVM is built directly into the Maple kernel rather than existing as a separate process that is called from Maple to perform the compilation task. This tight integration of the compiler provides the primary advantage over previous releases. Specifically, this streamlines calls to Compile since the overhead of creating a secondary process is eliminated. When compiling a procedure the resulting machine code is generated directly into main memory where it can be executed. In prior releases, Maple created a dynamically linked library which was then loaded prior to execution. The integration of LLVM reduces the number of costly disk accesses. 

Furthermore, LLVM was designed to be used in this situation and is therefore capable of producing efficient machine code in a quicker, more lightweight manner. 

The following figure displays the improvements in both compile and run time of Maple 18 in comparison to Maple 17 (64-bit Windows). 

Plot_2d 

Improvements for Polynomials

Efficiency improvements in Maple 18 have resulted in significantly faster performance for large polynomial operations. For more details, see Improvements in Polynomials .  

Plot_2d 

Plot_2d 

Plot_2d 

Plot_2d 

Linear Algebra - Singular Values

Floating-point computation of the singular value decomposition of a matrix has been upgraded to use a divide and conquer implementation based upon the DGESDD routine of CLAPACK. This brings a performance gain for both the SingularValues and the LeastSquares commands. 

The following graph was produced by using the LeastSquares command with option method=SVD on double-precision datatype=float[8] matrices and single right-hand-side vectors, running in 64-bit Linux on an Intel i5 760 2.80Ghz machine.  

Image

 

Linear Combination Efficiency

Maple 18 features performance updates that make arithmetic operations such as taking linear combinations of matrices or vectors much faster. The table below shows performance changes for 12 sample calculations. 

 

10 

11 

12 

Maple 17 

41.858 

4.748 

2.704 

0.204 

9.112 

7.120 

1.112 

0.016 

78.548 

29.741 

32.430 

29.753 

Maple 18 

0.280 

0.272 

0.004 

0.008 

0.001 

0.284 

0.832 

0.004 

0.236 

0.256 

0.256 

0.252 

Speed Up Factors 

149 

17 

676 

26 

9112 

25 

1.3 

4 

333 

116 

127 

118 

 

Embedded component

 

> Maple17Values := [41.858, 4.748, 2.704, .204, 9.112, 7.120, 1.112, 0.16e-1, 78.548, 29.741, 32.430, 29.753]; -1
 
> Maple18Values := [.280, .272, 0.4e-2, 0.8e-2, 0.1e-2, .284, .832, 0.4e-2, .236, .256, .256, .252]; -1
 
> SpeedUpFactors := `~`[`/`](Maple17Values, Maple18Values)
 
Typesetting:-mprintslash([SpeedUpFactors := [149.4928571, 17.45588235, 676.0000000, 25.50000000, 9112.000000, 25.07042254, 1.336538462, 4.000000000, 332.8305085, 116.1757812, 126.6796875, 118.0674603]...
Typesetting:-mprintslash([SpeedUpFactors := [149.4928571, 17.45588235, 676.0000000, 25.50000000, 9112.000000, 25.07042254, 1.336538462, 4.000000000, 332.8305085, 116.1757812, 126.6796875, 118.0674603]...
 
>
 
Plot_2d
 

Hardware and Special Functions

The Bessel functions BesselJ, BesselY, BesselI and BesselK, and the Hankel functions HankelH1 and HankelH2, have been added to Maple's core library of compiled special functions, for use in the evalhf environment. This results in significant efficiency improvements for operations such as plotting expressions involving Bessel functions. As a sample: 

> V := Array(0 .. 200, proc (i) options operator, arrow; `+`(`-`(100.), `/`(`*`(i, `*`(3.14159)), `*`(3))) end proc, datatype = float[8]); -1
 
> X := Array(0 .. 200, proc (i) options operator, arrow; `+`(`-`(100.), `/`(`*`(i, `*`(2.7172)), `*`(2.8))) end proc, datatype = float[8]); -1
 
> st := time(); -1; Array(0 .. 200, 0 .. 200, proc (i, j) options operator, arrow; BesselJ(V[i], X[j]) end proc, datatype = complex[8]); -1; `+`(time(), `-`(st)); 1
 
1.780

Improvements to the sort Command

In Maple 18, sorting is much faster due to parallelization of the sorting algorithms and the option of key sorting. The following graph shows the timing difference between sorts of random permutations run in Maple 17 and Maple 18. 

Plot_2d 

For more details on the improvements to sort, see the Language and Programming updates page. 


Graph Theory

Updates to the GraphTheory package have resulted in improved performance in the DrawGraph command for large graphs. This is the result of subroutines GetEdgesColor and GetEdgesThickness using sparse Matrices when the graph is sparse. The following table shows timing for some examples. For more details, see the Updates in Graph Theory page. 


Performance comparison

Graph 

Maple 18 

Mathematica® 9 

CycleGraph(10^3) 

0.124 s 

0.235 s 

CycleGraph(10^4) 

1.140 s 

2.226 s 

CycleGraph(10^5) 

18.10 s 

27.59 s