I am trying to speed up a program I wrote using MATLAB's built in VPA function. I am working with integers on the order of 5 to 6 million digits. The bottleneck in my code was converting a string to VPA where the conversion would take around 2.5 seconds. In order to solve this I thought I would use the Multiprecision Computing Toolbox. I downloaded the free trial and only made 2 alterations to my code. I set the mp.Digits value to 10 million (the same as the vpa digits value) and I replaced my vpa() function with mp(). After running the code multiple times I found that the mp version was significantly slower. As you can see in the picture below conversion to mp took 10 seconds while conversion to vpa took 2.5 seconds. Since I am new to the Multiprecision Computing Toolbox I very well could misunderstand how it is supposed to work. If anyone could tell me either a better way to solve my speed issue, and/or why mp is slower then please let me know.
Customer support service by UserEcho