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

workers vs activate nft markers in jsartoolkit #234

Open
albjeremias opened this issue Oct 13, 2021 · 3 comments
Open

workers vs activate nft markers in jsartoolkit #234

albjeremias opened this issue Oct 13, 2021 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@albjeremias
Copy link
Contributor

Hi! :)
I've been testing around and found out that in smartphones loading up to 10 NFT markers blows up the memory. I'm not using this library yet, but another version we made directly from jsartoolkit5 (wasm).

my question is, why did you choose to create a worker for each nft?!
My main answer is: For loading everything faster in different threads.

@kalwalt
Copy link
Member

kalwalt commented Oct 13, 2021

Hi! :) I've been testing around and found out that in smartphones loading up to 10 NFT markers blows up the memory. I'm not using this library yet, but another version we made directly from jsartoolkit5 (wasm).

my question is, why did you choose to create a worker for each nft?! My main answer is: For loading everything faster in different threads.

I think you are making a comparison between our jsartoolki5 and ARnft. Honestly i haven't thought in that terms, my intentions was simpler to provide a Multi NFT solution, because i haven't yet managed to solve some issues in the Multi NFT feature in JsartoolkitNFT see my PR webarkit/jsartoolkitNFT#102. But i think you are right probably it load faster.
Anyawy ARnft need to be improved, Comparing the jsartoolkitNFT and ARnft sinlge NFT marker example ARnft is much slower and with less fps in the Worker. Probably one issue is the update function in ARnft:

ARnft/src/ARnft.ts

Lines 203 to 208 in 14d6a7a

this.controllers[index].process(this.cameraView.getImage());
let update = () => {
this.controllers[index].process(this.cameraView.getImage());
requestAnimationFrame(update);
};
update();

If you some other idea, i'm open to other solutions.

@albjeremias
Copy link
Contributor Author

albjeremias commented Oct 14, 2021

ok i didn't made the right questions:
Is arnft using wasm version? or normal js?
I think that loading the nft markers in different workers makes it load much faster, but in terms of performance we get an out of memory when trying the same implementation with wasm jsartoolkit5. so i wonder if wasm loads way more stuff to the memory?
I believe that sending the image to all those workers is what might make it so slow, instead of using a solely worker and a single jsartoolkit5 instance loading all the nfts.

what i think is needed is to patch jsartoolkit5 so that loading could be faster, wasn't there an algorithm of compression for that? Or would be cool to be able to "copy" the memory blocks that jsartoolkit5 needs and only the first time you load on the browser takes time.. second time stores it on the local storage on the browser.. ?!

What i want is to share experiences and help improving this software, by sharing my experience and joining on improving the codebase.

@kalwalt
Copy link
Member

kalwalt commented Oct 14, 2021

Ok now i understood your intention.

Is arnft using wasm version? or normal js?

Because of jsartoolkitNFT it use WASM as single file.

so i wonder if wasm loads way more stuff to the memory?

It could be but i can not be sure.

I believe that sending the image to all those workers is what might make it so slow, instead of using a solely worker and a single jsartoolkit5 instance loading all the nfts.

But with jsartoolkiNFT is not so slow... That is a good point.

wasn't there an algorithm of compression for that?

Yes but not yet merged webarkit/jsartoolkit5#11, i think i need to work again on it. BTW we could integrate into jsartoolkitNFT and so ARnft....

@kalwalt kalwalt self-assigned this Nov 3, 2021
@kalwalt kalwalt added the question Further information is requested label Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants