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

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

Closed
kernelmethod opened this issue Feb 4, 2020 · 0 comments

Comments

@kernelmethod
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant