Skip to content
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

Optimize getSpriteTargetByName #215

Open
GarboMuffin opened this issue Jun 14, 2024 · 2 comments
Open

Optimize getSpriteTargetByName #215

GarboMuffin opened this issue Jun 14, 2024 · 2 comments

Comments

@GarboMuffin
Copy link
Member

O(n) right now, can be optimized to a map lookup

7% of runtime in a big project

@yuri-kiss
Copy link

So store the name in a map [NAME=>SPRITE]?

@FurryR
Copy link

FurryR commented Jul 3, 2024

So store the name in a map [NAME=>SPRITE]?

class Runtime {
  // ...
  targetMap: Map<string /** id **/, RenderedTarget>;
};

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

No branches or pull requests

3 participants