Closed minht11 closed 3 years ago
✔️ Deploy Preview for heuristic-ptolemy-02be89 ready!
🔨 Explore the source changes: 73273dbbe868fe493adde867abea935aaa3abdf4
🔍 Inspect the deploy log: https://app.netlify.com/sites/heuristic-ptolemy-02be89/deploys/611d95a51958030007a7437c
😎 Browse the preview: https://deploy-preview-9--heuristic-ptolemy-02be89.netlify.app/
Wow, this is way faster compared to what I tested. It somehow only took 2 seconds.
Previously each file handle was compared to one another using only
isSameEntry
, that's very expensive. Now we check if file names are also matching before usingisSameEntry
, because if file is renamed it will automatically won't match, so it's safe to do that. Other optimization is removing already found tracks from existing tracks search pool.Original diff, on my machine, with 462 tracks, took 11000ms, with this PR it takes about 300ms. 36x times improvement. Still this could be optimized even more.
Partially fixes https://github.com/minht11/local-music-pwa/issues/8