cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Mathcad Prime 8 is very slow - Tips or tricks to increase speed?

PEAH
12-Amethyst

Mathcad Prime 8 is very slow - Tips or tricks to increase speed?

Hi everyone

 

We have converted several Mathcad 15 sheets to Mathcad Prime 8 and are now seeing very slow performance, particularly when doing file opening and saving pdf. Opening a Mathcad file, recalculate it and print it to pdf earlier took around 30 seconds per file, now it takes 2-5 minutes.

 

  • We do not use reference sheets
  • We have a lot of programming constructions (e.g. if statements and lookups)
  • We use multi-threading, which improves speed a bit. We don't appear to get the full benefit when having multiple files open, i.e. the engine appears to do calculations in a single sheet at a time and then moves to the next sheet
  • For saving pdf, we are using the built-in pdf generator (i.e. the Save as command), this appears faster than printing to Adobe Acrobat pdf
  • The graphical user-interface appears delayed compared to the calculation engine (e.g. when hitting recalculate, the display is not always up-to-date, although there's a green dot in the lower left corner of the window). Part of the reason appears to be because dependent calculations are performed to the bottom of the worksheet, e.g. changing 10 variables in sequence implies that we have to wait for 10 "waves" of dependent calculations. Mathcad 15 only did the dependent calculations to the bottom of the screen and thus only needed to do the "final" dependent calculation
  • I admit that the sheets are somewhat lazy compared to "good programming practice". For example, arrays are dynamically sized but we don't set the full size initially. Also, we repeat some statements (e.g. max value of an array) rather than storing the result of the first statement. These things didn't give slow performance in Mathcad 15, however, this can of course have changed now

Can you please share any tips or tricks of your own experience on improving speed in Mathcad Prime 8?

 

Thanks!

15 REPLIES 15
Werner_E
25-Diamond I
(To:PEAH)

Unfortunately, I can't offer any tips on how to mitigate these shortcomings in Prime.
Prime's slowness in processing and sometimes quite cumbersome operation has been criticized here in the forum already several times. Unfortunately, however, no significant solutions to speed up could be offered.
Your comments sure make sense, are quite detailed and solid and if you still have some faith in PTC and the software developers and have not yet completely lost hope for improvements in future versions, you could try to contact PTC directly with this by opening a support case.

 

PEAH
12-Amethyst
(To:Werner_E)

Hi Werner, thanks for your reply.

PEAH
12-Amethyst
(To:Werner_E)

Anyone else who has some ideas?

VladimirN
24-Ruby II
(To:PEAH)

What PC configuration are you using?

PEAH
12-Amethyst
(To:VladimirN)

Hi Vladimir

 

It's a fairly strong laptop, running Windows 10 64-bit on Intel Core i7 2.60 GHz and with 64 GB memory. 

 

The slowness occurs also for Mathcad files that are stored on the desktop (i.e. it's not due to network lagging).

VladimirN
24-Ruby II
(To:PEAH)

1. Have you already opened a new "Case" in the technical support service?

 

"Mathcad Installation & Licensing Support Center":
https://support.ptc.com/support/mathcad_supportCenter.htm

https://support.ptc.com/apps/cs_loggers/case_logger/auth/ssl/log

 

2. Articles:

PEAH
12-Amethyst
(To:VladimirN)

Hi Vladimir

Thanks for sharing those articles which I have read but do not solve my problem. So I guess I need to raise a support ticket.

VladimirN
24-Ruby II
(To:PEAH)

Hi,

There are ways to speed up Prime.

I use what are called "masks" where vectorized statements are faster than sloppily written for loops and if statements.

In the enclosed "b" is the mask.  Speed increase is significant for big data sets.

I use this technique on datasets of 193819 x 9 and it makes a difference.

Capture.JPG

Cheers

Terry

Hi Terry

 

Cool, thanks a lot for that helpful suggestion, giving 40% speed increase in your example. We actually have a lot of formulas that should be able to be vectorized!

 

Kind regards

Peres

I guess that the main speed gain stems from avoiding the if-statement.

To compare the loop vs. vectorization you should use something like

Werner_E_0-1670329954391.png

Of course multithreading must be turned off to get a meaningful execution time 😉

 

Werner_E
25-Diamond I
(To:Werner_E)

OK, I gave it a try with a different timing method (and with an obviously slower machine) and the results seems to differ not that much and looping is slightly faster here than vectorization!?

Werner_E_0-1670333966345.png

Not sure if I am overlooking something ...

Multithreading sure has to be turned off here, too.

I attach the sheet for you to give it a try, too.

 

 

PEAH
12-Amethyst
(To:Werner_E)

Hi Werner

Sorry for the late reply, I'll try to enable my community notifications without being spammed. Thanks for the input and also demonstration of vectorization and functions of functions. I have changed your sheet and reattached two new versions. In both versions, I have used the average calculation time for 10 runs of each routine, and added routines f4 and f5, where vectors are pre-populated with zeros. In version A, I have also deleted the c vectors. The conclusion for my PC:

 

  • Version A ("fully vectorizable calculation sequence"):  Routine f3 is fastest, i.e. fully vectorized 
  • Version B ("partly vectorizable calculation sequence"): Routine f5 is fastest, i.e. a loop that avoids if statements. It looks like the f3 routine has some additional overhead in storing the b vector and thus ends up being slower.

PEAH_3-1672750386052.png

 

 

 

PEAH_2-1672750355093.png

 

 

 

 

 

 

 

Werner_E
25-Diamond I
(To:PEAH)

Basically same result here. The results in sheet B aren't far apart

Werner_E_0-1672759082878.png Werner_E_1-1672759091461.png

 

PEAH
12-Amethyst
(To:Werner_E)

Hi Werner

Thanks and good to see that you get the same results.

Announcements

Top Tags