Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to reduce Memory Usage? #29

Closed
Tomato6966 opened this issue Jul 12, 2023 · 0 comments
Closed

How to reduce Memory Usage? #29

Tomato6966 opened this issue Jul 12, 2023 · 0 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request question Further information is requested

Comments

@Tomato6966
Copy link
Owner

I created a branche, just for users who aim for low-memory usage, yet still want the high features from erela.js!

https://github.com/Tomato6966/erela.js/tree/slim

Honestly, if you look for most extreme low memory usage possible, use a different wrapper, or adjust it yourself. but the slim branche will allow you to save around 15-25% of memory usage (due to track + queue is trimmed a ton)

Also if you want to save memory usage for tracks, here is something you can also do:
the #requester which you provide by (message.author / interaction.user for example or interaction.member) can be anything you want, it's local for the client, so you know who requested what track, do something like that:

export function transformRequester(requester) {
    if(!requester) return null;
    return {
        id: requester.id,
        username: requester.username,
        avatar: requester.displayAvatarURL(),
    } 
    // example Use: 
    //      embed.addFields([ { name: `Requester`, value: `${track.requester.username} | Mention: <@${track.requester.id}>` } ])
    //           .setFooter({ text: `Requester-Id: ${track.requester.id}`, iconUrl: track.requester.avatar })
}
@Tomato6966 Tomato6966 pinned this issue Jul 12, 2023
Repository owner locked as resolved and limited conversation to collaborators Jul 12, 2023
@Tomato6966 Tomato6966 added documentation Improvements or additions to documentation enhancement New feature or request question Further information is requested labels Jul 12, 2023
@Tomato6966 Tomato6966 reopened this Jul 12, 2023
Repository owner unlocked this conversation Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant