Skip to content

Optimize geometry conversion code #1

Description

@TeodorVecerdi

I tried to optimize the code at the expense of some readability, but it's still quite slow.
It might be worth looking into https://docs.unity3d.com/Manual/JobSystem.html and refactoring code to work with that. The biggest performance hit comes from a big nested loop that should be easy to parallelize.

Performance breakdown:

  • GetDuplicateEdges: 66.2%
    • Self: 32%
    • List.get_Item: 15.8% (8,297,838 calls)
    • VectorUtilities.DistanceSqr - 12.8% (5,528,820 calls)
    • List.get_Count: 2.6% (1,385,660 calls)
  • RemapDuplicates: 18.6%
  • RemoveDuplicates: 3.3%
  • RemoveInvalidDuplicates: 0.7%
  • GetDuplicateVerticesMap: 0.3%

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions