sapphiredev / framework

Discord bot framework built on top of discord.js for advanced and amazing bots.
https://www.sapphirejs.dev/
MIT License
653 stars 73 forks source link

request: Can we have a support for discord.js-light #555

Closed Murtatrxx closed 2 years ago

Murtatrxx commented 2 years ago

Is there an existing issue or pull request for this?

Feature description

Recently, I tried using discord.js-light with sapphire but it's almost impossible without the dev's help.

Desired solution

We might get @sapphire/light as a separate package.

Alternatives considered

using default cache customization that djs provide

Additional context

No response

kyranet commented 2 years ago

I doubt we'll even bother implementing this, there's not much of a point once @discordjs/core is released.

Besides, we're underhanded even for the official discord.js v14 support.

favna commented 2 years ago

AFAIK you can already also configure the caching in DiscordJS to cache nothing which then means you basically have the same as DJs light, again, AFAIK.

I never understood why people use discord.js-light. @kyranet and I manage the Skyra bot which has details:

Statistics
• Users: 4,087,843
• Servers: 13,125
• Channels: 459,011
• Discord.js: v13.10.3
• Sapphire: v2.5.1
• Node.js: v16.17.0
Server Usage
• CPU Load: 3.37% | 3.31% | 3.26% | 3.54%
• Heap: 3,676.67MB (Total: 3,962.73MB)

Rounding down, 3.5 GB RAM is pretty normal for 13K servers. If your bot exceeds that server number then yeah you'll use more RAM but at that point you'll also be investing time (and money, which you hopefully recoup with donations or premium features) in one or more servers that can easily cover such RAM needs. For example, Skyra's server has a total RAM of 16GB and total usage of about 8GB so we can grow much much much more when looking at the current usage.

TL;DR: Reconsider whether you actually need discord.js-light

kyranet commented 2 years ago

discord.js-light's purpose is to greatly, if not completely remove discord.js's caching.

@discordjs/core will come out as a low-level high-performance cache-less library that uses only @discordjs/ws and @discordjs/rest, exposing raw data as a result. That's pretty much what anyone caring about memory usage in JS applications can dream about, specially because if discord.js-light's memory usage is low already, this new library will have even smaller CPU and memory footprint, if having official support from a large team and a large ecosystem to back it up isn't enough.

Murtatrxx commented 2 years ago

Okay, thanks. I’ll check them soon.

favna commented 2 years ago

I'm going to close this as not planned as per replies above.