Skip to content

Shapelist optimize #1694

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Apr 9, 2023
Merged

Shapelist optimize #1694

merged 10 commits into from
Apr 9, 2023

Conversation

einarf
Copy link
Member

@einarf einarf commented Apr 9, 2023

Optimize ShapeElementList.

  • Creation is around 25% faster
  • Adding new shapes is O(1) instead of O(N)
  • Added Color.random()

Also cleaned the module a bit. There are so many things we could improve in this module. There are lingering issues from arcade 1.x when line OpenGL line width was actually a thing. Indeally all the create methods should just be removed and instead located in a subclass of Shape.

This is too much work even think about for 3.0. We will probably just rely on pyglet shapes.

@einarf einarf merged commit b38bd08 into development Apr 9, 2023
@einarf einarf deleted the shapelist-optimize branch April 9, 2023 19:44
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.

1 participant