-
Notifications
You must be signed in to change notification settings - Fork 82
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
Think about changing Snowflakes/Permissions/DiscordBitSets/UserFlags/etc to value classes #711
Comments
Maybe add this in 1.0.0? These changes is hard breaking for api, but its ok if change major version too |
I already brought this up for 0.9.0, so maybe that's worth it, as 0.9.0 will break binary compatibility anyw and this shouldn't break source compatibility I am in favor of this |
@DRSchlaubi actually if u want to keep some checks (like |
#886 was merged and the changes can be tested using |
I was creating a entity cache server with Kord, and one of the things that I've noticed is the huge memory footprint.
(Using
-XX:+UseStringDeduplication
)In these tests, I'm caching...
Before:
After:
(The
LightweightSnowflake
still has a big footprint because Channels can have a nullable channel, so it ends up being boxed)Even though this would cause a binary incompatibility, I think it would be a good change to reduce the memory footprint used by Kord.
The
DiscordBitSet
would be hard to change tovalue
because it is mutable, and value classes cannot be mutable. I think that it would be nice to haveMutableDiscordBitSet
(orDiscordBitSetBuilder
?) instead of allowing the currentDiscordBitSet
to be mutable.The
Snowflake
would be hard to change tovalue
due to itsULong
constructor, which is used to coerce the value.Changing the
UserFlags
andPermissions
to value classes can be done in a straightforward manner.The text was updated successfully, but these errors were encountered: