Post#125 » Tue Feb 25, 2020 7:16 pm
Hey, everyone.
TL;DR - Icon Caching coming soon
Full story:
It's time to finally address and hopefully (mostly) neutralize the UI 'lag' in DreamPi Companion. I know this is a hindrance to my userbase and it's been requested to be patched over previous iterations.
While I have acknowledged these people and HAVE indeed provided patches here and there to supplement this, each patch only goes so far. Since DreamPi Companion connects to a network in order to function, lag continues to occur based on the end user's (your) internet speed, the speed and connection strength of Dreamcast.Online/Now/ and also the current task being handled by DreamPi Companion's back end (thread controller).
One MAJOR reason for delays would be the actual avatar icons of each user; DreamPi Companion connects to your network in order to download each avatar and store them into RAM. However, in order to save space for lower end machines, DreamPi Companion ONLY stores 9 LIVE and 9 FAVORITES avatars into RAM at once, as well as your own personal avatar. When you change to another page in either/or list, you'll notice a slight stutter because the previous icons are being 'unloaded' and new ones are being 'downloaded'. This very procedure is what lit a light bulb in my head.
Theoretically speaking, a mechanical hard drive, even ones as old as a quantum fireball, will always be faster than an internet connection (Any type via Wi-Fi or Wired) in terms of loading. So, what if we were to 'cache' each icon onto our HDD after downloading? Well, as I figured, the delay is nearly seamless now. Very minimal stutter, with this approach, at the expense of storing more data on our system. -- Each icon is about 6kb in size; The current database is roughly a little over 1000 players. Not everyone will have a database this large, unless you keep downloading the latest databases I upload to SourceForge. In other words, the average user will have anywhere between 30 to 120 icons stored (6*120=720kb), which in today's age of gigabytes and terabytes in nothing.
Of course, I understand that storing extra data is controversial and not everyone wants to cache, whether it be for this tool, a web browser or something else. So, Let's just make this feature a toggle!
It's more ethical to let the user choose, so we'll go with that. That being said, Icon Caching will be available in the next update.
This will eliminate A LOT of delay/"""lag""" that isn't Dreamcast.Online's fault. Some other 'tricks' are in my bag too... slowly getting there.
Author of original DreamPi Companion..