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

Speed issues megathread #59

Open
dalcde opened this issue Sep 5, 2019 · 2 comments
Open

Speed issues megathread #59

dalcde opened this issue Sep 5, 2019 · 2 comments

Comments

@dalcde
Copy link
Collaborator

dalcde commented Sep 5, 2019

rust_ext

extend_maps_to_unit

This function is a huge bottleneck in the resolver when there are multiple products to compute. A good amount of time is used to compute products. This can be avoided if we enable the cache-multiplication feature, but this is only feasible for finite-dimensional algebras. One possible way to improve this is to use a fixed-size cache for infinite dimensional algebras to cache the multiplications that happen the most often.

Even if cache-multiplication is enabled, this function is still pretty slow. I haven't profiled this properly to figure out the bottleneck.

ext-websocket

compute_edges

The compute_edges function computes the structlines that we have to display on every page. Mathematically, what it does is that it expresses the matrix for the product in terms of the E_r page basis for each r. This function is the main bottleneck in ext-websocket.

It is not entirely clear to me why this function is so slow. One possibility is just that there are many products to compute. Another possibility is that grouping the products by product type instead of the bidegree makes it slow if we want to compute the products with a fixed bidegree.

@dalcde dalcde changed the title Speed issues Speed issues megathread Sep 5, 2019
@dalcde
Copy link
Collaborator Author

dalcde commented Sep 7, 2019

One possible thing that might help is to define versions of fp_vector functions where we know that the vectors are not sliced to save some checks.

@hoodmane
Copy link
Collaborator

hoodmane commented Sep 7, 2019

Also, using unsafe functions to access elements of arrays without checking array bounds in the performance critical functions and in general skip whatever automatic checking Rust does would probably be a good idea. If we do this, we might also add more unit tests to reduce the probability of weird edge case errors.

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

2 participants