Skip to content

Suggestion: Avoid Allocating a New Double Array in PerceptualHash.Hash #125

@developerjoy

Description

@developerjoy

Hello,

Thank you for the excellent work on CoenM.ImageSharp.ImageHash! It has been very helpful for my project.

I noticed that the PerceptualHash.Hash implementation allocates a new double array every time it is called. While this works well functionally, it can lead to frequent memory allocations, especially when processing a large number of images. This could negatively impact performance due to increased garbage collection.

Would it be possible to optimize the method to reuse the double array or use a more memory-efficient approach?

Thank you for considering this suggestion!

Best regards,
Costa

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions