zalo / CascadeStudio

A Full Live-Scripted CAD Kernel in the Browser
https://zalo.github.io/CascadeStudio/
MIT License
1.03k stars 129 forks source link

Questions about performances #100

Closed antonymarion closed 3 years ago

antonymarion commented 3 years ago

Hi all,

First of all, thank you for porting opencascade to wasm, it rocks!

I am having one issue using one of the examples from cadhub.xyz

The example I am using is the following: https://cadhub.xyz/u/chnorzibaert/through-hole-resistors-box/ide

I am testing how the 3D Viewer behave once we increase the value of numberOfCompartmentsHorizontal from 8 to 64 for instance.

And once I use 64 in cascadeStudio (instead of 8) then the loader is stuck at state "UNION"

image

Since the provided algo (from cadhub) is not so simple, I tested on a very simple X,Y translation of a cylinder, and then I got:

image

ending with

image

Am I missing something or is there any performance limitation to keep in mind? In other words my question is: is CascadeStudio suitable for 2D or 3D grids of basic objects (cylinders for instance) ?

Regards, Antony

zalo commented 3 years ago

OpenCascade wasn't particularly performant to begin with, but the translation to Javascript/WASM has slowed things down a bit.

The linked Cadhub example works on my machine, but I can tell that it's very resource intensive. It's unsurprising that increasing the workload 8x grinds it to a halt.

It's possible that some newer compilation of opencascade.js improves performance/memory stability (due to newerish versions of Emscripten), but it's a small chance. You can see a bit of my experiences with that here (as well as find a beta version that uses this backend).

For really heavy projects, you may be better off with a different system (like CadQuery, which uses a C++ compilation of OpenCascade in its backend).

antonymarion commented 3 years ago

Thanks for your swift reply !

Indeed the beta did the trick on a basic laptop.

cheers