-
Notifications
You must be signed in to change notification settings - Fork 64
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
Suggest optimizion for retrive image buffer. #230
Comments
Ohhh! Thank you for this! 😄 |
If I could ask, could you explain how this works? |
Sure. At first I just cache some vars which relate to |
Rad perfect, makes sense. Was asking, so I can optimize some other things. Thanks! 😄 |
Need to look. I just opened the random file and decide make this suggestion) |
btw did you see this? |
@MaxGraey Yes! I have seen that, just haven't gotten around to it 😂 |
Also are you try just do: this.canvasImageData.data.set(this.imageDataArray); instead: for (let i = 0; i < this.imageDataArray.length; i++) {
this.canvasImageData.data[i] = this.imageDataArray[i];
} in this line? |
Yeah, I could definitely do that instead, been slowly replacing my for loops with set 😄 |
@MaxGraey Thanks! Yeah, I really need to learn/use the inline decorator. My plan was to use closure compiler over my JS output, but preserve function names in the output. And simply inline all of the functions that closure is inlining 😄 But I'll definitely go through and do those as well 😄 Thank you SOOOO much this is all really appreciated! |
Current method: https://github.com/torch2424/wasmBoy/blob/bcc26f197b9516f136d385b7ffad1d7734b7d4da/lib/graphics/worker/imageData.js#L4
could be optimize to:
The text was updated successfully, but these errors were encountered: