# Optimization of Solid Boolean Operations

Hi all,
I got some massive boolean operations to do with multiple geometries which include a lot of complex freefrom shapes. In GH, they take a lot of time, up to hours. So I was wondering if it could be optimized somehow by performing parts of the boolean operations seperately. Thus, I did some experiments, that showed this might be possible. However, I’d like to unterstand deeplier what happens internally. So here is a simple example of what I’d like to understand better:

As you can see, depending on the order and seperation of the operations one can save a significant percentage of calculation time. Why is that? What makes the difference there? Does anybody know? Any other hints how to accelerate solid booelan operations?

A couple of tips:

1. NEVER describe an issue via an Image: nobody (sane) would spend time on that. Meaning : always post a representative case (gh + data).
2. There’s various ways to speed random VS random bool ops: one is a pre check for Ccx events using Boxes (this means use first pair Intervals (x, y, z) bool ckecks: if these fail then there’s no Ccx. If these are true then MAY are Ccx events around). Obviously doing the Boxes takes time … but nothing in this life is free.
3. Parallel (obviously with some robust thread safety policy) MAY is a way to speed things.
4. RTree Clustering (*) MAY speed things.
5. R is a Surface (**) modeller: if you want absolute performance on “solid” bool ops … use a proper Solid app (preferably using the ParaSolids engine). Find a friend who knows a thing or two on that matter and ask a demo.

(*) for instance this C# does RTree Clustering (for Ccx events) using 2000 Boxes in 7 ms. Obviously if we replace Boxes with Blobs … Elapsed would be far greater … but you get the gist I do hope.

(**) for instance using just 27 “solids” (and doing bool diff - all VS all) takes 91 ms (that’s a hideous amount of time). Yellows are separated results for inspection.

or worst: