Skip to content

Reduce memory allocation when increasing the number of coefficients for SimHash #12

Closed
@kernelmethod

Description

@kernelmethod

Currently, in order to sample new coefficients for SimHash, we use the following code:

@views new_coeff[old_n+1:end,1:end] = randn(n - old_n, n_hashes)

It'd be more efficient to run map! on the new_coeff array, since the code above allocates a new array of size (n-old_n) x n_hashes which is immediately thrown away.

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