Skip to content

perf(cad): import solidworks assemblies faster and skip re-parsing unchanged step files - #206

Merged
AadiJo merged 2 commits into
mainfrom
faster-solidworks-import
Nov 3, 2026
Merged

AadiJo merged 2 commits into
mainfrom
faster-solidworks-import

Conversation

@AadiJo

@AadiJo AadiJo commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Local CAD imports were slower than they needed to be in two cases.

SolidWorks assemblies. The two halves of the import ran back to back: SolidWorks exported every part to STEP first, and occt only started meshing once the last export was done. Now meshing starts as soon as SolidWorks writes each part. The bridge appends every finished export to out/exported.txt, and the server reads that list four times a second and meshes each new part while SolidWorks exports the rest. Each mesh runs in the caller's scope, so cancelling an import still stops every occt worker. Parts the list misses are meshed after the bridge's result, as before. occt still runs at most two workers across imports, and STEP and IGES imports now share that limit. exportParts now takes a prepare function and returns each part's geometry instead of its STEP bytes.

Unchanged STEP and IGES files. A Sync of an unchanged SolidWorks file already reused the latest snapshot, but STEP and IGES files were parsed again every time. That check now covers every format. An unchanged re-sync keeps the same snapshot instead of making an identical new one, so the rollback slot no longer fills with a copy.

Results, against real SolidWorks 2025:

  • A 12-part shooter assembly with one occt worker went from 23.0 s and 22.9 s to 19.0 s and 18.9 s, with identical snapshot assets. The saving grows with the meshing time that can overlap the export. apps/server/scripts/local-cad-import-timing.ts reruns the comparison on any file.
  • A Sync of an unchanged 22.5 MB STEP went from 14.2 s to 0.2 s and returned the same snapshot.

A first import of a STEP file is not faster. Nearly all of its time is in occt-import-js parsing the file, already on its latest release.

Proof: the timing script before on main and after on this branch (peak RSS under 1.6 GB), the live SolidWorks test suite with the pillow block and virtual-component samples (30 passed), the updated unchanged-file test failing against the old import and passing with the new, and a cancel 45 s into a real 87-part import that exited cleanly with its job folder removed.

Reviewed with sol-loop: 2 rounds with gpt-6.1-sol. Sol verdict: approved

@vercel

vercel Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
cadsense Skipped Skipped Nov 3, 2026 11:40pm UTC

@AadiJo AadiJo changed the title perf(cad): import solidworks assemblies faster by meshing parts while solidworks exports perf(cad): import solidworks assemblies faster and skip re-parsing unchanged step files Nov 3, 2026
@AadiJo
AadiJo merged commit 42d1c5e into main Nov 3, 2026
17 of 18 checks passed
@AadiJo
AadiJo deleted the faster-solidworks-import branch November 26, 2026 19:50

This branch was previously deployed

1 inactive deployment
Preview — b66cda6c Deployed Nov 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant