Posts

🛠️ Splinter-lands Tool Update: Memory Leaks, Performance Tweaks & Rarity Boosts!

6 comments·0 reblogs
beaker007
73
0 views
·
min-read

Image from thread

Hey hey!
We’re back with another round of updates to the Splinter-lands tool.

This week’s update is a bit more technical, so consider this one a NERD ALERT 🚨. But don’t worry, there’s something for everyone in here—from behind-the-scenes dev stuff to new features you’ll see in the UI. Let’s get into it.

🔍 Updates at a Glance

  • Reduced memory footprint
  • Performance improvements using profiling
  • Rarity boost now shown per deed
  • Taxes toggle added to deed overview
  • Some small bug fixes 🐞

🧠 Memory Footprint – Why Did The App Die?! 😵

Okay, let’s talk about The Oh No Screen™️. You may have seen something like this pop up (especially while I’m asleep, classic timing 😅):

image.png

This has happened a few times, usually tied to the app doing its daily update of all region/resource info. My best guess? We're hitting Streamlit’s resource limits—probably RAM rather than disk.

Looking at Streamlit's free-tier limits:Image from thread

No way I’m using 50GB of storage (which is wild generous for a free app, btw). So that leaves memory.

Previously, during region/resource pulls, memory usage peaked around 1,000MB. That’s a lot, especially if multiple users open the app early in the day (which triggers the update). That combo could easily hit Streamlit’s 2.5GB RAM ceiling.

🧪 Debug Mode to the Rescue

So I added a debug mode to track memory use, and sure enough: memory peaked around 1.2GB. But I managed to bring that down to ~700MB by tweaking how data is handled:

✅ Temporary pickles for intermediate data
✅ Final DataFrames only stored once

Here’s the result (which can be viewed live at, https://splinter-lands-dev.streamlit.app/) :Image from thread

Hopefully, that stops the app from crashing, I still find the memory at startup pretty high unfortunately. But if you do see the error screen again, just ping me. A restart usually clears it up, and I’ll dig deeper.

🚀 Performance Improvements

If you’re into Python or Streamlit, this part’s for you.

Streamlit is super easy to work with, but it redraws the entire page on every interaction. Not the most efficient—especially for a data-heavy app with many UI elements like this.

So I used wfork-streamlit-profiler to see where the app slows down. Just a pip install away!
Image from thread
Image from thread
Note: This is not enable on the dev or production environment only manual added to my local setup.

Turns out get_player_deed_overview() was the biggest culprit—no surprise there, since it makes a bunch of SPL API calls to fetch staked assets.
After it has cashed the data the same page loading in 1.8 seconds in stead of the 6.5 seconds.

image.png

I’ve now cached that function so it caches data for a 1h, This way it becomes faster after the initial pain of fetching the deed data.
Also added a visual representation where its busy with:

image.png

Also: the screen I personally find most useful (production + taxes + aura boosts) fetches fresh data constantly for now. Might change that if it starts to slow things down.Image from thread

🧙‍♂️ Rarity Boost – Now in the Deed Overview!

I’ve added a total boost and rarity boost breakdown directly to the deed overview. Finally, a quick way to see where your best cards are giving that extra edge.
Image from thread

💰 Taxes Toggle

Want to see deed values with or without taxes? There’s now a handy Include Taxes checkbox in the deed overview.

image.png

🔧 A Quick Note on the Project

This tool is a hobby project I work on in my spare time, built using Streamlit + Supabase (both free tiers).
So sometimes, things break. 😅
If the app crashes or looks weird, just let me know. It’s usually an easy fix!

💡 Got Ideas? Found a Bug?

I’d love your feedback—this is an open-source tool built for the community.

📂 GitHub: https://github.com/gamerbeaker007/splinter-lands

Open an issue, drop a comment, or just message me with your ideas!

Hope you enjoy the updates and insights, and I’ll see you all on the battlefield! 🧙‍♂️⚔️

Image from thread

Do you also want to be part of this amazing play to earn game consider using my referral link.