Performance Test Macro?

MJuric
Posts: 1067
Joined: Mon Mar 08, 2021 3:21 pm
Answers: 1
x 31
x 873

Performance Test Macro?

Unread post by MJuric »

Are there any macro's or example of macros that do some number of operations with existing models and tracks performance?

I've seen something like this from some hardware companies and I tried...and failed, to write one for myself.

I'd like to be open a file, do something to it, copy, array, move, delete parts, insert parts, rotate, section etc etc and then measure time it takes to do the entire thing.
User avatar
AlexB
Posts: 455
Joined: Thu Mar 18, 2021 1:38 pm
Answers: 25
x 245
x 405

Re: Performance Test Macro?

Unread post by AlexB »

There's built in performance testing in Solidworks Rx on the benchmark tab that does exactly this.
image.png
MJuric
Posts: 1067
Joined: Mon Mar 08, 2021 3:21 pm
Answers: 1
x 31
x 873

Re: Performance Test Macro?

Unread post by MJuric »

AlexB wrote: Wed May 17, 2023 1:11 pm There's built in performance testing in Solidworks Rx on the benchmark tab that does exactly this.

image.png
I'm aware of that. I want to specifically use our models and use operations that we do/use most often. Not only do I want to use it to compare machine performances but I also want to use it to test "Modeling practices" and effect on performance.
TTevolve
Posts: 228
Joined: Wed Jan 05, 2022 10:15 am
Answers: 3
x 78
x 145

Re: Performance Test Macro?

Unread post by TTevolve »

Just hit the record macro button, go through he steps to create something and then save it. Only thing you would have to add would be the timer function, but you could do that by stop watch. You might want to have a list of steps if your making a more complicated model.

I did something similar a while back, I took a large assembly and opened it on an older machine and then on a newer machine. Based on the time just to open and/or save the file you would gain around a 30% to 40% speed increase (I think this was back in SW 2016) with newer hardware. I did this to show that we could ROI on the cost of a new upgraded PC in 6 to 6 months time frame. We switched to upgrading all our engineering PC's every 4 years.
User avatar
Frederick_Law
Posts: 1851
Joined: Mon Mar 08, 2021 1:09 pm
Answers: 8
Location: Toronto
x 1554
x 1404

Re: Performance Test Macro?

Unread post by Frederick_Law »

Get current time before and after run in macro. No timer required.
Record might not record everything but could give you something to start.
MJuric
Posts: 1067
Joined: Mon Mar 08, 2021 3:21 pm
Answers: 1
x 31
x 873

Re: Performance Test Macro?

Unread post by MJuric »

TTevolve wrote: Wed May 17, 2023 3:08 pm Just hit the record macro button, go through he steps to create something and then save it. ....
I tried this a while back but I ran into enough issues that didn't work that it just didn't seem to be the right approach.

I will look at this again and try it and report back on the problems I have. I believe it was not doing any sort of manipulation(rotating part) correctly and then was also not doing some things, arrays etc.

When I looked at the macro it was a big enough mess that I just gave up.

Thank You
User avatar
SPerman
Posts: 1888
Joined: Wed Mar 17, 2021 4:24 pm
Answers: 13
x 2064
x 1723
Contact:

Re: Performance Test Macro?

Unread post by SPerman »

I have had very little luck using "record macro." It records some things, but misses the majority of operations.
-
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
User avatar
AlexB
Posts: 455
Joined: Thu Mar 18, 2021 1:38 pm
Answers: 25
x 245
x 405

Re: Performance Test Macro?

Unread post by AlexB »

SPerman wrote: Thu May 18, 2023 8:25 am I have had very little luck using "record macro." It records some things, but misses the majority of operations.
Recording a macro almost always results in unusable code that doesn't capture most of what the user is doing. It gives insight to some operations, but 99% of cases require someone with API knowledge to go in and make it do what it missed. And that can be cumbersome.
MJuric
Posts: 1067
Joined: Mon Mar 08, 2021 3:21 pm
Answers: 1
x 31
x 873

Re: Performance Test Macro?

Unread post by MJuric »

AlexB wrote: Thu May 18, 2023 8:30 am Recording a macro almost always results in unusable code that doesn't capture most of what the user is doing. It gives insight to some operations, but 99% of cases require someone with API knowledge to go in and make it do what it missed. And that can be cumbersome.
Which was my experience exactly. When I looked at the macro itself it looked absolutely horrific and appeared to be such a mess that "fixing" it would have been more of a project than writing it from scratch. At least that's what it looked like from my very limited experience perspective.
User avatar
josh
Posts: 270
Joined: Thu Mar 11, 2021 1:05 pm
Answers: 12
x 20
x 465

Re: Performance Test Macro?

Unread post by josh »

I wrote a benchmark for a guy once. It's certainly possible but not quite as simple as recording (as you found out). If you feel like it would be of value to have a custom benchmark, feel free to drop me a DM. I enjoy writing SW stuff so I work pretty cheap.
Post Reply