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 getTexture func #269

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

piman51277
Copy link
Contributor

Minor changes to execution order, results in about 5% extra performance with static and 20% extra performance if further optimized through ISchema.

For reference, the 20% performance boost can be gained by filtering out the "number":"name" entries from the schema.getTextures() output. This roughly halves the search space, which is the source of this extra performance.

Minor optimization updates
+ Caches result of Object.keys() for increased performance
+ Strips unused items from search pool and caches the result

Now provides ~40% boost for static and a ~100% boost for more optimized implementations. (For the parseEconItem function)
@piman51277
Copy link
Contributor Author

Performance has been further increased to 40% boost for static and 100% boost for further optimizations. The previous tip about filtering out unused entries in the search space has been integrated directly within getTexture.

@danocmx
Copy link
Owner

danocmx commented Jul 14, 2023

I'm not against this but it cannot use the global scope for caching, since you can inject your own schema and texture's can differ.

@piman51277
Copy link
Contributor Author

Although it's less than ideal, would it be feasble to actually cache in the injected Schema?

I can see a potential problem arising with collisions between the property used for caching and whatever the injected Schema uses

@danocmx
Copy link
Owner

danocmx commented Jul 14, 2023

I don't want to introduce any breaking changes as of currently, so this improvement will need to wait until rewrite.

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.

2 participants