Storage limits #3
Replies: 3 comments 2 replies
-
Greetings, SessionStorage/LocalStorage has a hard limit of 5MB[1]. I am currently experimenting with a very rough new version of the fs module that uses IndexedDB[2] as its backend, which should provide three key advantages over the current solution:
Unfortunately, it is not all roses and sunshine though. IndexedDB is asynchronous with no synchronous API available, meaning that synchronous functions like unlinkSync() need to be rebuilt with some sort of lock that wastes CPU time waiting for the promise to be resolved to emulate synchronous operation for the function (i.e. by looping as long as the promise is not resolved, with an Atomics-based wait of 10-50ms between loops; better suggestions are welcome!). The synchronous fs functions are required for BetterDiscord to work, so skipping them is not an option. I cannot give any concrete timeframe for when this work will hit the repository, as it is still highly in flux. But it is actively being worked on. References: |
Beta Was this translation helpful? Give feedback.
-
Small update for those interested/subscribed to this topic and the state of this task. The BadDespite JavaScript being a single-threaded language, there is apparently no way to deliberately block execution programmatically like in other programming languages. This sounds good until you notice that there is also no waitAsync or processEvents equivalent and that the end of a loop run does not trigger the event processing. Since the As mentioned before, IndexedDB is asynchronous and, as I recently learned, so are the operations to convert
The GoodDo not let the previous points turn you off (except if you rock only 512MB RAM!).
The RestThe following changes are of note for the upcoming release:
Release ScheduleI am currently field-testing the feature-complete package before pushing the commit to the master branch, so that stability issues, API incompatibilities/quirks, performance issues and onboarding/migration problems can be taken care of beforehand to make this something users can look forward to. In case everything goes smoothly, I anticipate that I will push the changes next weekend (somewhere in the vicinity of 2022-09-10). |
Beta Was this translation helpful? Give feedback.
-
Wow, that's really cool! Discord is now much faster to launch (especially when you have 50+ plugins). Thank you very much for the work done, it has become much more comfortable to work in web discord. |
Beta Was this translation helpful? Give feedback.
-
What about storage limits? 5 mb is very small, is there a way to increase this limit?
Beta Was this translation helpful? Give feedback.
All reactions