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 the number subtractions in get_lagrange_coefficients by half #657

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

jonas-lj
Copy link
Contributor

@jonas-lj jonas-lj commented Sep 30, 2023

It's possible to cache the n^2 differences computed in get_lagrange_coefficients and use this to reduce the number of subtractions by half.

I'm not sure this is a bottleneck as it is, but I did some profiling with 1000 indices and here, about 20-25% of the time is spent on the subtractions.

@benr-ml Feel free to use this if you think it's needed, otherwise you can just close the PR.

@benr-ml
Copy link
Contributor

benr-ml commented Oct 1, 2023

Great idea!
Since in practice we compute those coefficients for the same set of parties many times, I wonder if we should generate the cache in a preprocessing stage and just pass it as an optional input. Let me think about that...

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

Successfully merging this pull request may close these issues.

None yet

2 participants