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

feat: allow removing properties from cached objects #10633

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

TempVoice
Copy link

Please describe the changes this PR makes and why it should be merged:
Cache only the properties you need and remove the undesired one. This greatly improves the memory footprint.

For example, the channel.topic property of channels which consumes dozens of bytes. If a bot operates in thousands of servers this can waste unnecessary memory.

const client = new Client({
	undesiredProperties: {
		ChannelManager: ["topic"]
	}
})

Goal is to support caching from other managers too.
I am open for what you guys think about it. I am willing to battle test this for a bot with >150k servers.

Copy link

vercel bot commented Dec 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
discord-js ⬜️ Ignored (Inspect) Visit Preview Dec 4, 2024 8:02am
discord-js-guide ⬜️ Ignored (Inspect) Visit Preview Dec 4, 2024 8:02am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

1 participant