Improve performance by using more sets #1

Merged
Darks merged 1 commits from :master into master 2019-06-05 00:22:57 +02:00
Contributor

Most of the program currently uses lists and tends to check list members with in, which is much more efficient with sets. Also two functions manipulate a set of black pixels, with subset and set difference operations, implemented from lists.

This pull requests replaces many list structures with sets, and normalizes lines by sorting the tuples. This significantly improves performance, with speedups ranging from 10x to 50x, and removes the need for duplicate removal.

See Utiliser le Sprite Optimizer (#165850) for more details.

Most of the program currently uses lists and tends to check list members with `in`, which is much more efficient with sets. Also two functions manipulate a set of black pixels, with subset and set difference operations, implemented from lists. This pull requests replaces many list structures with sets, and normalizes lines by sorting the tuples. This significantly improves performance, with speedups ranging from 10x to 50x, and removes the need for duplicate removal. See [Utiliser le Sprite Optimizer (#165850)](https://www.planet-casio.com/Fr/forums/lecture_sujet.php?id=15315&page=last#165850) for more details.
Darks approved these changes 2019-06-05 00:22:19 +02:00
Darks closed this pull request 2019-06-05 00:22:57 +02:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Darks/sprite-optimizer#1
No description provided.