Skip to content

optimization #2

@semibran

Description

@semibran

There are actually plenty of good box packing algorithms out there, but I made my own version without much regard for optimization since I had planned on using it for a spritesheet generator anyway. Surprisingly, I've found that arranging a mere six boxes creates upwards of 1000 permutations on average and already takes a few seconds to load. Seven boxes made Chromium lock up entirely in my own experience and required a system restart.

I haven't done benchmarks yet (which is another issue entirely), but I'm assuming there's a large performance bottleneck stemming from recursion and the subsequent mass object creation that's going on.

Basically, I'd love to create an imperative version of this algorithm or at least find some loopholes to keep memory usage to a bare minimum.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions