Tweaking for Speed

November 20, 2008 · Filed Under MeshCAM Development 

My "secret project" depends on machining a number of small objects at very high accuracy.  Because of this I’ve been having out-of-memory problems on my development laptop; this required digging back into some of the deeper guts of MeshCAM that have been untouched for a while.  I found three relatively simple optimizations, maybe 20-30 lines of code, that collectively lead to significant speed increases.

 

Below are the before and after results of my new speed test script that automates this type of testing.  The speed test calculates a parallel finish toolpath on the standard "cheese whiz" model 5 times and averages the results.  The 30% reduction may or may not be typical but all finishing toolpaths should benefit.

 

  Memory use should also be reduced somewhat during toolpath calculation. 

 

image image

 

UPDATE: Ok, maybe not 30%.  I found a bug that required me to give back part of that optimization.  Count on something more like 15%.

UPDATE TO THE UPDATE: Ok, maybe better than 30%.  I found another place to shave off some time and I exceeded the count above.  The new best time is about 10 seconds so the current improvement is about 36%.  Let’s hope I don’t find any new bugs that make be have to give that up.

Comments

4 Responses to “Tweaking for Speed”

  1. Randy on November 20th, 2008 9:56 pm

    Robert,

    That sounds good! If it wouldn’t be giving away any proprietary information, could you share the tolerance and roughing parameters you’re using for the speed tests? My standard settings are .0005″ tolerance and 15 roughing quality.

    Best regards,

    Randy

  2. Robert on November 21st, 2008 6:57 am

    1/8″ Ball mill, .01″ stepover, .001″ tolerance. I don’t have roughing enabled in that test but when I do I use a value of 4.

    I needed a test that could be completed quickly so I could run it multiple times to average them without having to walk away and get more coffee. I can get about a 15% variance if I do only one run.

    -Robert

  3. Adam Talbot on November 21st, 2008 8:54 am

    Have you looking into using Cuda?
    http://www.nvidia.com/object/cuda_home.html#
    Just an off the wall idea :-)

  4. Robert on November 21st, 2008 9:50 am

    Adam-

    I haven’t yet. There are lots of academic papers that use the GPUs to speed the process but I’ve been too afraid of compatibility problems to try any. Maybe I will try something like that over the next few years.

    For now multicore chips offer the best bang for the buck in terms of programming effort.

    -Robert