VSC Code Optimisation

I’ve been working on some code I wrote about 10 years ago – it analyses the reduction in daylight levels to a building/window due to neighbouring obstructions (implementing the Vertical Sky Component method).

Typically, I run simulations on 10–20 windows, taking 5–10 minutes depending on the complexity of the 3D geometry.

But I’ve taken on a much bigger project with 717 neighbouring windows (and complex 3D geometry) – it would be extremely impractical to run multiple 6hr+ simulations when iterating through design stages – it isn’t the 90’s anymore!

So I tried a simple change to the code – reducing the resolution of the sky model drastically (~100x lower). The result? A nearly imperceptible loss in accuracy (only evident in the 2nd decimal place), and a 64x speedup – from 16s down to 0.25s per window for a simple test model!

The point is, sometimes there can be a bottleneck in our product, performance or process, that has been overlooked due to excessive risk adversity or simply because of embedded inefficiencies that are seldom reviewed.

Where in your workflow might a simple change lead to exponential gains?

(PS – code intentionally garbled in screenshot!)

Leave a Reply