Skip to content

Scalability Issue with csg.js #12

@mtippett

Description

@mtippett

Hi,

It looks like the scalability of csg.js is O(n^2). See code in https://github.com/mtippett/jscad-test/tree/master/jscad-csg-perf, this includes both the nodejs application and a svg created with Brendan Gregg's flamegraph tool.

Basically this is an array of coplanar cubes.

screen shot 2017-02-12 at 1 28 29 am

Looking at the flamegraph generated for a 40x40 square (1600 elements), the scalability issue is clear in the code searching for a union. The original npm jscad code would not re-tesselate and optimize, so would result in larger files. The file size is workable with jscad/csg.js, however the scalability needs to be improved.

screen shot 2017-02-12 at 1 38 17 am

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions