Skip to content

Conversation

@ZephyrRaine
Copy link
Contributor

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Does your submission pass tests?

Description:

Replaced vertices array with a Map in order to check existence with simple O(1) lookup instead of O(n) indexOf. Greatly reduces export times and no diff detected on .obj outputs. This fixes #1407 where more details can be found.

Tests:

All tests passed, except one for web that already wasn't passing after a fresh clone.

@ZephyrRaine ZephyrRaine changed the title Replaced indexOf() with a Map - fixes #1407 Improve .obj serialization times - fixes #1407 Nov 19, 2025
Copy link
Contributor

@hrgdavor hrgdavor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice performance improvement

Copy link
Member

@z3dev z3dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ZephyrRaine These changes look fine. It would be nice to get some statistics on the performance improvement.

By the way, V2 changes are released periodically so these changes will probably be released in January. Is that ok?

@z3dev z3dev merged commit 93d5df5 into jscad:master Nov 22, 2025
2 checks passed
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.

Serialization duration varies greatly between obj and stl

3 participants