Skip to content

Conversation

@12345jy
Copy link
Contributor

@12345jy 12345jy commented Dec 8, 2024

Description

This change improves load times for SplashKit Online C++ Compiler by caching decompressed files in memory to avoid repeated decompression. It reduces the load time when multiple copies of SK Online are running by returning cached decompressed data if available, otherwise performing decompression once.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as
    expected)
  • Documentation (update or new)

How Has This Been Tested?

Tested by loading the compiler multiple times, ensuring decompressed files are cached and reused for faster subsequent loads.

Testing Checklist

  • Tested in latest Chrome
  • Tested in latest Safari
  • Tested in latest Firefox

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have requested a review from ... on the Pull Request

@github-actions
Copy link

github-actions bot commented Dec 8, 2024

🐋 PR Preview!
The preview is no more!
Congrats if this was merged! 😄

Copy link
Contributor

@UberNomad UberNomad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, the patch looks good. It certainly works.

I have a couple questions and a potential suggestion.

Would it be possible to use localStorage? That way it could be cached, even after the page is refreshed. Although, if this was a design choice, I reckon it'd be worth commenting the reason you used a global variable rather than localStorage.

@12345jy
Copy link
Contributor Author

12345jy commented Dec 21, 2024

Hi @UberNomad,Thank you for your feedback and suggestions! To address the refresh issue, I’ve used IndexedDB instead of localStorage for better handling of data persistence. I’ve also added comments to clarify this design choice.

@pradeepkumara
Copy link

Hey, that works great! The code is super clear—anyone can read and get it. The flow is spot on. Just try to focus on code deduplication; that's the only thing I noticed. Other than that, everything's perfect!

@WhyPenguins WhyPenguins changed the base branch from main to download-caching-wip March 13, 2025 18:32
@WhyPenguins WhyPenguins merged commit 61c51c6 into thoth-tech:download-caching-wip Mar 13, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants