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

Deserialize to ArrayString instead of String for ImageHash #2467

Merged
merged 1 commit into from
Jun 24, 2023

Conversation

GnomedDev
Copy link
Member

This saves an allocation on creation of ImageHash, but adds a new dependency that is not currently in the dep tree at all.

I chose the arrayvec crate over smallvec, tinyvec, or heapless as:

  • smallvec will fall over to heap allocation if length exceeds the capacity
  • tinyvec and smallvec does not include an ArrayString
  • heapless contains a lot of unnecessary data structures that may bloat compile time

@github-actions github-actions bot added the model Related to the `model` module. label Jun 13, 2023
@arqunis arqunis added enhancement An improvement to Serenity. breaking change The public API is changed, resulting in miscompilations or unexpected new behaviour for users dependencies Related to Serenity dependencies. and removed breaking change The public API is changed, resulting in miscompilations or unexpected new behaviour for users labels Jun 16, 2023
@arqunis arqunis merged commit 4145d84 into serenity-rs:next Jun 24, 2023
mkrasnitski pushed a commit to mkrasnitski/serenity that referenced this pull request Sep 21, 2023
…Hash` (serenity-rs#2467)

This saves an allocation on creation of `ImageHash`.
mkrasnitski pushed a commit to mkrasnitski/serenity that referenced this pull request Oct 17, 2023
…Hash` (serenity-rs#2467)

This saves an allocation on creation of `ImageHash`.
mkrasnitski pushed a commit to mkrasnitski/serenity that referenced this pull request Oct 24, 2023
…Hash` (serenity-rs#2467)

This saves an allocation on creation of `ImageHash`.
arqunis pushed a commit to arqunis/serenity that referenced this pull request Oct 24, 2023
…Hash` (serenity-rs#2467)

This saves an allocation on creation of `ImageHash`.
arqunis pushed a commit to arqunis/serenity that referenced this pull request Oct 24, 2023
…Hash` (serenity-rs#2467)

This saves an allocation on creation of `ImageHash`.
@GnomedDev GnomedDev deleted the add-arraystring branch February 22, 2024 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Related to Serenity dependencies. enhancement An improvement to Serenity. model Related to the `model` module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants