11 Replies Latest reply on Apr 18, 2017 4:45 PM by Alin Vargatu

    How to improve linear pattern rebuild performance by ~10X 

    Shaodun Lin

      Couple days ago, I received a part from VAR ( Value-Added Reseller) and asked me how to improve the rebuild performance of a complex part. The part is an SMD (Surface Mount Device) leadframe, in order to cut down the production cost, one leadframe usually consists several hundred or more than a thousand of units.

      And this is how one SMD unit might look like: (below is an SMD LED component)

      The part from VAR came with massive pattern feature, the number of the pattern instance is 1320 (!), the file size is 175MB and it takes 20 minutes to open the file and regenerate graphics. The total rebuild time is 13336 seconds, or 3 hours 42 minutes and 16 seconds, as you can see below, most of the rebuild time is spent on the pattern features. ( By the way, I have never seen a part with such a long rebuild time.)

      So, how to deal with this problem? In order to understand the relation between number of instances and the rebuild time, I performed a simple experiment. I varied the number of instances in a part and measure the rebuild time for each case. After plotting the data in Excel and fit the points with a trendline, surprisingly I saw a perfect second order polynomial curve!

      Now I understand why the rebuild time is so long! Because the rebuild time is not linearly proportioned to the number of instances, in fact, it grows exponentially with the number of instances! Based on above trendline equation, when the number of instances for a linear pattern is 1320, the rebuild time will become 11289 Seconds!

      With above understanding, it is time to figure out how to reduce the rebuild time. We know that:

      Which means if I break a massive pattern into many smaller patterns, the total rebuild time of those smaller patterns should be significantly shorter than a massive pattern. The actual result proves that my math was correct, with the new method, the rebuild time is reduced by 10 times!

      The disadvantage of above method is you have to build more base features for the small patterns, but that is an easy task as I use Sketch Block and Equation to help me reuse the sketches. Eventually, mission accomplished!

      Update:

      After I posted this article, I did some Google search using keyword like "How to improve pattern performance ", there are some articles suggest that pattern body and then perform Boolean operation is faster than the normal feature pattern method. I did some test using the pattern body + Boolean operation method ( using SOLIDWORKS feature Combine ). Here is the result:

      This looks quite promising. For example, when number of instances = 255, the Body Pattern + Boolean Operation is 6 times faster than feature pattern!

      But when I extrapolate number of instances to 1320 instances, things changes dramatically, the rebuild time for feature pattern is faster after number of instance is more than 1080.

      This is indeed an interesting result, it means when number of instances is less than 600, it is worth to try the Body Pattern + Boolean Operation method to reduce the rebuild time, but when pattern instances increases further, I think it is still better to use the method I mentioned previously ( break a large pattern into smaller patterns).

      My other articles in LinkedIn Pulse:

      https://www.linkedin.com/pulse/say-file-orruption-shaodun-lin

      https://www.linkedin.com/pulse/large-assembly-performance-diagnostic-solidworks-2017-shaodun-lin

      https://www.linkedin.com/pulse/solidworks-upgrade-assistant-shaodun-lin

      https://www.linkedin.com/pulse/windows-solidworks-setting-optimization-simplified-version-lin

      https://www.linkedin.com/pulse/step-by-step-guide-shrinking-sql-transaction-log-file-shaodun-lin

        • Re: How to improve linear pattern rebuild performance by 10X
          Dan Pihlaja

          I am curious:

          You said:

          "The disadvantage of above method is you have to build more base features for the small patterns, but that is an easy task as I use Sketch Block and Equation to help me reuse the sketches. Eventually, mission accomplished!"

           

          What if you created one body, patterned it, then patterned the pattern?

          Example:  Lets say you need a total of 10000 instances in a 100X100 pattern with a spacing of 10 mm.  So, you create 1 body in the upper left corner of the pattern.  Then pattern that one body in a 10X10 pattern with a spacing of 100 mm.  Then patterned that pattern in another 10X10 pattern with a spacing of 10 mm.

           

          This would get you the same result, but I am wondering on rebuild times.  (I am in the middle of a big project, so I can't test it out here.)

            • Re: How to improve linear pattern rebuild performance by 10X
              Shaodun Lin

              Hi Dan:

               

              I performed this test as well.

              I think the rebuild time of a  [ 10x10 ] x [ 10x10 ] pattern will be approx. 20~40% lesser compare with a 100 x 100 pattern. [1]

               

              So far the best approach to reduce the rebuild time for a massive pattern is still to use the principle below: ( Especially when the number of  instances is more than 1000 )

              Raw data for [1]

              2017-03-14_9-26-57.png

               

              Note:

              1. For 225 Instance, the " two features pattern"  was created in this way: [ 3x3 ] x [ 5x5 ]

              1.png

              2. For 400 instance, the " two features pattern" was created in this way: [ 4x4 ] x [ 5x5 ]

              3. For 324 instance, the " three features pattern" was created in this way: [ 2x2 ] x [ 3x3 ] x [ 3x3 ]

            • Re: How to improve linear pattern rebuild performance by 10X
              Mark Biasotti

              That's very interesting Shaodun, Thanks for sharing your findings.

               

              Mark

              • Re: How to improve linear pattern rebuild performance by 10X
                Chris Clouser

                Here's my 2 cents:  don't use patterns.  In this case where there are too many instances, you may be stuck with it.  But I have found that the tedious process of inserting each bolt, each washer, each nut, etc. gives me a much faster assembly and actually saves time in the long run.

                 

                The example above looks as if it would benefit from some feature reduction if possible.

                 

                I have a problem with large pattern fill features, such as cut holes if we want to create a piece of expanded metal or a cooling vent with a honeycomb cutout.  I'm not sure it would be easy to break a fill up and pattern the fill?  Maybe?   And will that even help?

                 

                I believe that the software should be capable of doing what is discussed above: taking a user-inputted pattern and behind the scenes breaking up the pattern to optimize the performance.  The user would not even have to know what is happening.  I submitted an ER on this.

                • Re: How to improve linear pattern rebuild performance by 10X
                  Christian Chu

                  Interesting !!! Thx for sharing Shaodun

                  Will play around with your study here !

                  • Re: How to improve linear pattern rebuild performance by ~10X
                    Doug Seibel

                    What about using sketch pattern to pattern the sketch or sketch block, and then you only have a single extrude feature?  How does that help/hurt the filesize, opening times, and rebuild times?

                      • Re: How to improve linear pattern rebuild performance by ~10X
                        John Pesaturo

                        All joking aside, sketch patterns are sketchy ... That is to say that it's been my experience to avoid sketch patterns whenever possible. Modifying or fine tuning sketch patterns can be a bit tricky as they aren't always as straight forward as you would figure they should be.

                         

                        I would add however that since the release of SW2017 I have found their functionality to be much better. I have been burned by them too many times to count in the past though so I'm still a bit skeptical.

                      • Re: How to improve linear pattern rebuild performance by ~10X
                        Alin Vargatu

                        Thanks, Shaodun! Great stuff.

                         

                        Are your colleagues working on making patterning more efficient, or is it a Parasolid limitation?

                        Can the patterning of features (not bodies) be multi-threaded, or all operations on one body are single threaded?