Video-Hub-App icon indicating copy to clipboard operation
Video-Hub-App copied to clipboard

[FEATURE] speed up auto-tag generation

Open whyboris opened this issue 1 year ago • 6 comments

Looks like JS for loop is far faster than forEach (see video)

The slowest part of the auto-tag generation process is already outsourced to a web worker but it's currently using forEach

  • https://github.com/whyboris/Video-Hub-App/blob/main/src/app/components/tags-auto/tags.worker.ts#L31
  • https://github.com/whyboris/Video-Hub-App/blob/main/src/app/components/tags-auto/tags.worker.ts#L59
  • https://github.com/whyboris/Video-Hub-App/blob/main/src/app/components/tags-auto/tags.worker.ts#L89

We may be able to get 2x the speed with a simple for loop 🤞 🚀 🤞

whyboris avatar Oct 31 '24 18:10 whyboris

Hi! can i claim this issue?

riddhi-b avatar Nov 07 '24 04:11 riddhi-b

Hey @riddhi-b - you've claimed the issue ✅ 🤝

If you can, could you also perform some sort of a speed test to see if the change is worth it? 🙇‍♂️

whyboris avatar Nov 07 '24 18:11 whyboris

@whyboris Thanks! Sure I will try, is there a specific tool or anything you like to use to perform speed checks or are you ok with me using anything I can find?

riddhi-b avatar Nov 30 '24 22:11 riddhi-b

@riddhi-b - I suspect console.time() is the easiest, though feel free to use whatever you'd like 👍

whyboris avatar Dec 04 '24 03:12 whyboris

I would like to address this issue if it is still open.

Deepak-SBaghel avatar Sep 27 '25 02:09 Deepak-SBaghel

Hey @Deepak-SBaghel - I believe this was fixed with this PR: https://github.com/whyboris/Video-Hub-App/pull/875

whyboris avatar Sep 29 '25 14:09 whyboris