-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Steamtracker fixes; version increment #54
Conversation
BTW, why do we have the setTimeout(() in line 348? |
Both improves lookup performance and fixes a bug where we were looking for the app id as string when it was an integer.
According to https://jsbench.me/3pkjlwzhbr/1 an object key lookup is indeed the fastest. I was thinking maybe |
(I was going by https://github.com/anvaka/set-vs-object myself.) To really squeeze out performance we'd need to see how much effort it is on each page load to
|
I thought I could delete it, but I was wrong. This is added to avoid having the page hang when loading, because it is waiting on our script execution. |
ST returns
appid
as int, which was breaking functionality because we were===
-comparing to a.toString()
.I noticed we do a
.find
on an array here, which is potentially quite slow, so instead I changed it to one-time convert array to object for O(1) lookups and (hopefully 😆) added code to remove old storage if needed.The dynamicstore-sourced lookups are done using
.includes
. I assume making a set or object out of all those arrays would make for faster lookups, but might be computationally expensive itself as many people poll a fresh dynamicstore on every single web request.